From 40f1404344d09520e91d6d3cb9ccd23b786ca35e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 25 Jun 2012 17:54:22 +0300 Subject: Fix issues #1529 & #1530 --- system/database/DB_query_builder.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/database/DB_query_builder.php') diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index 439530714..4c43fe3c3 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -470,8 +470,8 @@ abstract class CI_DB_query_builder extends CI_DB_driver { if ($escape === TRUE) { $k = (($op = $this->_get_operator($k)) !== FALSE) - ? $this->escape_identifiers(substr($k, 0, strpos($k, $op))).strstr($k, $op) - : $this->escape_identifiers($k); + ? $this->escape_identifiers(trim(substr($k, 0, strpos($k, $op)))).' '.strstr($k, $op) + : $this->escape_identifiers(trim($k)); } if (is_null($v) && ! $this->_has_operator($k)) @@ -609,7 +609,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { if ($escape === TRUE) { - $key = $this->escape_identifiers($key); + $key = $this->escape_identifiers(trim($key)); } $prefix = (count($this->qb_where) === 0) ? $this->_group_get_type('') : $this->_group_get_type($type); -- cgit v1.2.3-24-g4f1b