From c1c4d8380e6e1a2fb5eeed2e3051f2507a68614e Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sun, 19 Oct 2014 14:45:34 -0400 Subject: Update PicoDb --- vendor/PicoDb/Database.php | 5 +++++ vendor/PicoDb/Drivers/Mysql.php | 1 - vendor/PicoDb/Drivers/Sqlite.php | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/vendor/PicoDb/Database.php b/vendor/PicoDb/Database.php index 5d0beb8a..c09d8a92 100644 --- a/vendor/PicoDb/Database.php +++ b/vendor/PicoDb/Database.php @@ -86,6 +86,11 @@ class Database public function escapeIdentifier($value) { + // Do not escape custom query + if (strpos($value, '.') !== false || strpos($value, ' ') !== false) { + return $value; + } + return $this->pdo->escapeIdentifier($value); } diff --git a/vendor/PicoDb/Drivers/Mysql.php b/vendor/PicoDb/Drivers/Mysql.php index 22277a01..96148a1c 100644 --- a/vendor/PicoDb/Drivers/Mysql.php +++ b/vendor/PicoDb/Drivers/Mysql.php @@ -70,7 +70,6 @@ class Mysql extends \PDO { public function escapeIdentifier($value) { - if (strpos($value, '.') !== false) return $value; return '`'.$value.'`'; } } \ No newline at end of file diff --git a/vendor/PicoDb/Drivers/Sqlite.php b/vendor/PicoDb/Drivers/Sqlite.php index 83b61c40..38c823ae 100644 --- a/vendor/PicoDb/Drivers/Sqlite.php +++ b/vendor/PicoDb/Drivers/Sqlite.php @@ -51,7 +51,6 @@ class Sqlite extends \PDO { public function escapeIdentifier($value) { - if (strpos($value, '.') !== false) return $value; return '"'.$value.'"'; } } \ No newline at end of file -- cgit v1.2.3