summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-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;