summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2019-02-14 18:27:06 +0100
committerAndrey Andreev <narf@devilix.net>2019-02-14 18:27:06 +0100
commit493ed6c472af3270cf995647a02c385c7f0500b3 (patch)
tree0f321489c12b72a8a4ad29f7d2ea8a34af43b735 /system/database
parent5d30345236fbef3303d6852a5b28eab80c43fd18 (diff)
[ci skip] More on #4186
Diffstat (limited to 'system/database')
-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;