From d8364c4267ddccb64ac330067162a3ce0d4e08c2 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 4 Jun 2008 17:01:00 +0000 Subject: bit of a code cleanup --- system/database/DB_active_rec.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'system/database/DB_active_rec.php') diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 17cdc3220..4eff400c1 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -427,7 +427,7 @@ class CI_DB_active_record extends CI_DB_driver { { $prefix = (count($this->ar_where) == 0) ? '' : $type; - if ( ! $this->_has_operator($k) && is_null($key[$k])) + if (is_null($v) && ! $this->_has_operator($k)) { // value appears not to have been set, assign the test to IS NULL $k .= ' IS NULL'; @@ -447,6 +447,9 @@ class CI_DB_active_record extends CI_DB_driver { { $k = $this->_protect_identifiers($k); } + + $v = ' '.$this->escape($v); + } if ( ! $this->_has_operator($k)) @@ -454,11 +457,6 @@ class CI_DB_active_record extends CI_DB_driver { $k .= ' ='; } - if ($v !== NULL AND $escape === TRUE) - { - $v = ' '.$this->escape($v); - } - } else { @@ -471,6 +469,7 @@ class CI_DB_active_record extends CI_DB_driver { } $this->ar_where[] = $prefix.$k.$v; + if ($this->ar_caching === TRUE) { $this->ar_cache_where[] = $prefix.$k.$v; -- cgit v1.2.3-24-g4f1b