Skip to content

Commit

Permalink
[fix] Check table name for tableQuote()
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelaon committed Dec 9, 2019
1 parent e78be9e commit a6d88e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Medoo.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ public function exec($query, $map = [])
{
echo $this->generate($query, $map);

$this->statement = null;
$this->debug_mode = false;

return false;
Expand Down Expand Up @@ -476,6 +475,11 @@ public function quote($string)

protected function tableQuote($table)
{
if (!preg_match('/^[a-zA-Z0-9_]+$/i', $table))
{
throw new InvalidArgumentException("Incorrect table name \"$table\"");
}

return '"' . $this->prefix . $table . '"';
}

Expand Down

0 comments on commit a6d88e7

Please sign in to comment.