diff options
Diffstat (limited to 'system/database/DB_driver.php')
-rw-r--r-- | system/database/DB_driver.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index eca2e68a7..e9efc8914 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -971,7 +971,7 @@ abstract class CI_DB_driver { */ public function escape_identifiers($item) { - if ($this->_escape_char === '') + if ($this->_escape_char === '' OR empty($item)) { return $item; } @@ -984,8 +984,8 @@ abstract class CI_DB_driver { return $item; } - // Avoid breaking functions inside queries - elseif (strpos($item, '(') !== FALSE) + // Avoid breaking functions and literal values inside queries + elseif (ctype_digit($item) OR $item[0] === "'" OR strpos($item, '(') !== FALSE) { return $item; } |