From 493ed6c472af3270cf995647a02c385c7f0500b3 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 14 Feb 2019 19:27:06 +0200 Subject: [ci skip] More on #4186 --- system/database/DB_query_builder.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'system/database') 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; -- cgit v1.2.3-24-g4f1b