Skip to content

Commit

Permalink
fix query check with single line SELECT. fixes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
splitbrain committed Jan 7, 2025
1 parent 22cb60d commit d791316
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function getPDO($dsn = null, $user = null, $pass = null)
*/
public function executeQuery($query, $dsnalias = null)
{
if (!preg_match('/^select /i', trim($query))) {
if (!preg_match('/^select(\s|$)/i', trim($query))) {
throw new \Exception('For security reasons only SELECT statements are allowed in dbquery');
}

Expand Down

0 comments on commit d791316

Please sign in to comment.