summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/database/DB_driver.php3
-rw-r--r--system/database/DB_query_builder.php5
2 files changed, 3 insertions, 5 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index ea56d3819..02c64f9f1 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -1167,9 +1167,8 @@ abstract class CI_DB_driver {
if (empty($_operators))
{
$_les = ($this->_like_escape_str !== '')
- ? preg_quote(trim(sprintf($this->_like_escape_str, $this->_like_escape_chr)))
+ ? '\s+'.preg_quote(trim(sprintf($this->_like_escape_str, $this->_like_escape_chr)))
: '';
-
$_operators = array(
'\s*(?:<|>|!)?=\s*', // =, <=, >=, !=
'\s*<>?\s*', // <, <>
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index 139f467e6..9c6cb7e45 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -2050,8 +2050,6 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
{
if (count($this->$qb_key) > 0)
{
- $sql = ($qb_key === 'qb_having') ? "\nHAVING " : "\nWHERE ";
-
for ($i = 0, $c = count($this->$qb_key); $i < $c; $i++)
{
if ($this->{$qb_key}[$i]['escape'] === FALSE)
@@ -2081,7 +2079,8 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
.' '.trim($matches[4]).$matches[5].$matches[6];
}
- return implode("\n", $this->$qb_key);
+ return ($qb_key === 'qb_having' ? "\nHAVING " : "\nWHERE ")
+ .implode("\n", $this->$qb_key);
}
return '';