summaryrefslogtreecommitdiffstats
path: root/system/database/DB_query_builder.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/DB_query_builder.php')
-rw-r--r--system/database/DB_query_builder.php17
1 files changed, 8 insertions, 9 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index 3154d148b..9bd535b0e 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -644,17 +644,11 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
? $this->_group_get_type('')
: $this->_group_get_type($type);
- if (is_null($v) && ! $this->_has_operator($k))
- {
- // value appears not to have been set, assign the test to IS NULL
- $k .= ' IS NULL';
- }
-
if ( ! is_null($v))
{
if ($escape === TRUE)
{
- $v = ' '.(is_int($v) ? $v : $this->escape($v));
+ $v = ' '.$this->escape($v);
}
if ( ! $this->_has_operator($k))
@@ -662,6 +656,11 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
$k .= ' = ';
}
}
+ elseif ( ! $this->_has_operator($k))
+ {
+ // value appears not to have been set, assign the test to IS NULL
+ $k .= ' IS NULL';
+ }
$this->{$qb_key}[] = array('condition' => $prefix.$k.$v, 'escape' => $escape);
if ($this->qb_caching === TRUE)
@@ -2540,7 +2539,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
{
$str = trim($str);
- if (empty($str))
+ if (empty($str) OR ctype_digit($str) OR (string) (float) $str === $str OR in_array(strtoupper($str), array('TRUE', 'FALSE'), TRUE))
{
return TRUE;
}
@@ -2553,7 +2552,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
? array('"', "'") : array("'");
}
- return (ctype_digit($str) OR in_array($str[0], $_str, TRUE));
+ return in_array($str[0], $_str, TRUE);
}
// --------------------------------------------------------------------