summaryrefslogtreecommitdiffstats
path: root/system/database/DB_active_rec.php
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2008-04-06 21:58:20 +0200
committerDerek Allard <derek.allard@ellislab.com>2008-04-06 21:58:20 +0200
commit16629b1cef61db05646839d6789d98ddc5aaf16b (patch)
tree0dcf40090cdd96e5815bf489f19e86639fd38668 /system/database/DB_active_rec.php
parent96863ce12d88b2126b80bf1b00a73eed1ad6be86 (diff)
Fixed a bug that wasn't allowing escaping to be turned off if the value of a query was NULL.
Diffstat (limited to 'system/database/DB_active_rec.php')
-rw-r--r--system/database/DB_active_rec.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php
index b2638f25c..d58580637 100644
--- a/system/database/DB_active_rec.php
+++ b/system/database/DB_active_rec.php
@@ -447,14 +447,19 @@ class CI_DB_active_record extends CI_DB_driver {
$k .= ' =';
}
- if ($v != '')
+ if ($v !== '' AND $v !== NULL)
{
$v = ' '.$this->escape($v);
}
}
else
{
- $k = $this->_protect_identifiers($k, TRUE);
+
+ if ($escape === TRUE)
+ {
+ $k = $this->_protect_identifiers($k, TRUE);
+ }
+
}
$this->ar_where[] = $prefix.$k.$v;