Fix a few join() bugs
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index d5367b4..1060ecc 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -970,7 +970,7 @@
*/
public function escape_identifiers($item)
{
- if ($this->_escape_char === '')
+ if ($this->_escape_char === '' OR empty($item))
{
return $item;
}
@@ -983,8 +983,8 @@
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;
}