Browse Source

Fix BETWEEN and NOT BETWEEN conditions.

```
PHP Notice – yii\base\ErrorException

Undefined offset: 3

in .../yiisoft/yii2/db/QueryTrait.php at line 269
```
tags/2.0.0-rc
Sergey Gonimar 11 years ago
parent
commit
322e9e2385
  1. 2
      framework/db/QueryTrait.php

2
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 [];
}
}

Loading…
Cancel
Save