summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-25 16:54:22 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-25 16:54:22 +0200
commit40f1404344d09520e91d6d3cb9ccd23b786ca35e (patch)
tree38eaa944647c4a3cd61fe8377b43988e76d48051 /system
parent35443c6be9e181bdefe8d3c7851cd305caafde15 (diff)
Fix issues #1529 & #1530
Diffstat (limited to 'system')
-rw-r--r--system/database/DB_query_builder.php6
-rw-r--r--system/database/drivers/postgre/postgre_driver.php4
2 files changed, 5 insertions, 5 deletions
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);
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php
index 21968a8dd..e73122bc7 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -617,8 +617,8 @@ class CI_DB_postgre_driver extends CI_DB {
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))