From 322e9e2385f905c19087ee90390fd37c35abfbc4 Mon Sep 17 00:00:00 2001 From: Sergey Gonimar Date: Thu, 17 Apr 2014 21:42:11 +0600 Subject: [PATCH] Fix BETWEEN and NOT BETWEEN conditions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` PHP Notice – yii\base\ErrorException Undefined offset: 3 in .../yiisoft/yii2/db/QueryTrait.php at line 269 ``` --- framework/db/QueryTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/db/QueryTrait.php b/framework/db/QueryTrait.php index c7635ce72e..541c4fa2ac 100644 --- a/framework/db/QueryTrait.php +++ b/framework/db/QueryTrait.php @@ -266,7 +266,7 @@ trait QueryTrait case 'BETWEEN': case 'NOT BETWEEN': if (array_key_exists(1, $condition) && array_key_exists(2, $condition)) { - if ($this->isEmpty($condition[2]) || $this->isEmpty($condition[3])) { + if ($this->isEmpty($condition[1]) || $this->isEmpty($condition[2])) { return []; } }