diff options
author | Andrey Andreev <narf@devilix.net> | 2015-07-27 20:54:18 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-07-27 20:54:18 +0200 |
commit | 2dfbe9997b28892342e826e9350a466e6bacfd2e (patch) | |
tree | 7d9f25e7506093da2f9ac53c7c66d2e2c2a6fe24 /system/database/DB_query_builder.php | |
parent | d80ecd66346370d91d78e1ad6bec029117144b1a (diff) |
Revert "Fix #3989"
This reverts commit e1a94d30e2f30cee36f71c246136fb2db34d25df.
Diffstat (limited to 'system/database/DB_query_builder.php')
-rw-r--r-- | system/database/DB_query_builder.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index 0bb91bae9..da8820421 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -1276,7 +1276,8 @@ abstract class CI_DB_query_builder extends CI_DB_driver { foreach ($key as $k => $v) { - $this->qb_set[$this->protect_identifiers($k, FALSE, $escape)] = $this->escape($v); + $this->qb_set[$this->protect_identifiers($k, FALSE, $escape)] = ($escape) + ? $this->escape($v) : $v; } return $this; @@ -1515,9 +1516,15 @@ abstract class CI_DB_query_builder extends CI_DB_driver { ksort($row); // puts $row in the same order as our keys - foreach ($row as $k => $v) + if ($escape !== FALSE) { - $row[$k] = $this->escape($v); + $clean = array(); + foreach ($row as $value) + { + $clean[] = $this->escape($value); + } + + $row = $clean; } $this->qb_set[] = '('.implode(',', $row).')'; @@ -1938,7 +1945,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { $index_set = TRUE; } - $clean[$this->protect_identifiers($k2, FALSE, $escape)] = $this->escape($v2); + $clean[$this->protect_identifiers($k2, FALSE, $escape)] = ($escape === FALSE) ? $v2 : $this->escape($v2); } if ($index_set === FALSE) |