summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2008-06-04 19:01:00 +0200
committerDerek Allard <derek.allard@ellislab.com>2008-06-04 19:01:00 +0200
commitd8364c4267ddccb64ac330067162a3ce0d4e08c2 (patch)
tree3b78029655597551e8b7deebba3cddcdb16e15cb
parent694096e5923057bec182726ef6fc8dbd2908978d (diff)
bit of a code cleanup
-rw-r--r--system/database/DB_active_rec.php11
1 files changed, 5 insertions, 6 deletions
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;