Skip to content

Commit

Permalink
Fix potential null issue in rawAddPrefix method
Browse files Browse the repository at this point in the history
  • Loading branch information
CassianoRafael authored Sep 15, 2023
1 parent 5159467 commit 2f5d7f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions MysqliDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,10 @@ public function rawAddPrefix($query){
preg_match_all("/(from|into|update|join|describe) [\\'\\´]?([a-zA-Z0-9_-]+)[\\'\\´]?/i", $query, $matches);
list($from_table, $from, $table) = $matches;

// Check if there are matches
if (empty($table[0]))
return $query;

return str_replace($table[0], self::$prefix.$table[0], $query);
}

Expand Down

0 comments on commit 2f5d7f2

Please sign in to comment.