From 16629b1cef61db05646839d6789d98ddc5aaf16b Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 6 Apr 2008 19:58:20 +0000 Subject: Fixed a bug that wasn't allowing escaping to be turned off if the value of a query was NULL. --- system/database/DB_active_rec.php | 9 +++++++-- user_guide/changelog.html | 3 ++- user_guide/database/active_record.html | 32 ++++++++++---------------------- 3 files changed, 19 insertions(+), 25 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; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 62e4541e0..1efaa6b2a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -63,7 +63,8 @@ Change Log
  • Active Record +
  • Fixed a bug that wasn't allowing escaping to be turned off if the value of a query was NULL.
  • +
  • Config