diff options
author | Andrey Andreev <narf@devilix.net> | 2014-09-17 10:13:46 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-09-17 10:13:46 +0200 |
commit | 2c6cdd7d3ac4c929bf6fa172b6ba48c282e3a831 (patch) | |
tree | 04a3b51697fbb344e306af60cceeddb978e784ed /system/database/DB_query_builder.php | |
parent | dc0ad20329ed3c3f800f3fe0b68f73cff970cdb2 (diff) |
Fix #3238
Close #3239
Diffstat (limited to 'system/database/DB_query_builder.php')
-rw-r--r-- | system/database/DB_query_builder.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index f11f84627..4e37e4c03 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -663,11 +663,15 @@ abstract class CI_DB_query_builder extends CI_DB_driver { } else { - $operator = trim($this->_get_operator($k)); - - if ($operator === '<>' OR $operator === '!=') + $operator = $this->_get_operator($k); + if (stripos($operator, 'NULL') === FALSE) { - $k = str_replace($operator, ' IS NOT NULL', $k); + $op = strrpos($k, $operator); + if (strlen($k) === ($op + strlen($operator))) + { + $operator = strtr($operator, array('<>' => 'IS NOT', '!=' => 'IS NOT')); + $k = substr($k, 0, $op).rtrim($operator).' NULL'; + } } } |