summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2013-10-28 13:13:09 +0100
committerAndrey Andreev <narf@devilix.net>2013-10-28 13:13:09 +0100
commit8adac96fdc90cfc8c667d64b95ae29845808947b (patch)
tree136219dc9c9742a19a1523e247a76125db5c7627 /system
parent28a3692b2b43d9ffd0eb7668fb64c3347c676722 (diff)
Fix CI_DB_query_builder::_merge_cache() triggering E_WARNINGs
Kudos to kakysha for noting the bug & providing initial fix in PR #2698
Diffstat (limited to 'system')
-rw-r--r--system/database/DB_query_builder.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index a36501eb6..95c3af3a9 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -2551,11 +2551,13 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
$qb_variable = 'qb_'.$val;
$qb_cache_var = 'qb_cache_'.$val;
- if (count($this->$qb_cache_var) === 0)
+ if (count($this->$qb_cache_var) > 0)
{
- continue;
+ foreach ($this->$qb_cache_var as &$cache_var)
+ {
+ in_array($cache_var, $this->$qb_variable, TRUE) OR $this->$qb_variable[] = $cache_var;
+ }
}
- $this->$qb_variable = array_merge($this->$qb_variable, array_diff($this->$qb_cache_var, $this->$qb_variable));
}
// If we are "protecting identifiers" we need to examine the "from"