summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/database/DB_query_builder.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index eca9fb38b..12949c7dc 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -874,9 +874,14 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
{
$qb_cache_key = ($qb_key === 'qb_having') ? 'qb_cache_having' : 'qb_cache_where';
- if ($key === NULL)
+ if (empty($key) OR ! is_string($key))
{
- return $this;
+ throw new InvalidArgumentException(sprintf('%s() expects $key to be a non-empty string', debug_backtrace(0, 2)[1]['function']));
+ }
+
+ if (empty($values))
+ {
+ throw new InvalidArgumentException(sprintf('%s() expects $values to be a non-empty array', debug_backtrace(0, 2)[1]['function']));
}
is_bool($escape) OR $escape = $this->_protect_identifiers;