Skip to content

Commit 2f5d7f2

Browse files
Fix potential null issue in rawAddPrefix method
1 parent 5159467 commit 2f5d7f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

MysqliDb.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,10 @@ public function rawAddPrefix($query){
556556
preg_match_all("/(from|into|update|join|describe) [\\'\\´]?([a-zA-Z0-9_-]+)[\\'\\´]?/i", $query, $matches);
557557
list($from_table, $from, $table) = $matches;
558558

559+
// Check if there are matches
560+
if (empty($table[0]))
561+
return $query;
562+
559563
return str_replace($table[0], self::$prefix.$table[0], $query);
560564
}
561565

0 commit comments

Comments
 (0)