Commit 2a8ca600 by Alexander Makarov

Simplified parameter check for buildSimpleCondition()

parent 47ee0b87
...@@ -995,7 +995,7 @@ class QueryBuilder extends Object ...@@ -995,7 +995,7 @@ class QueryBuilder extends Object
*/ */
public function buildSimpleCondition($operator, $operands, &$params) public function buildSimpleCondition($operator, $operands, &$params)
{ {
if (empty($operands[0]) || !array_key_exists(1, $operands)) { if (count($operands) !== 2) {
throw new InvalidParamException("Operator '$operator' requires two operands."); throw new InvalidParamException("Operator '$operator' requires two operands.");
} }
......
...@@ -1203,7 +1203,7 @@ class QueryBuilder extends \yii\base\Object ...@@ -1203,7 +1203,7 @@ class QueryBuilder extends \yii\base\Object
*/ */
public function buildSimpleCondition($operator, $operands, &$params) public function buildSimpleCondition($operator, $operands, &$params)
{ {
if (empty($operands[0]) || !array_key_exists(1, $operands)) { if (count($operands) !== 2) {
throw new InvalidParamException("Operator '$operator' requires two operands."); throw new InvalidParamException("Operator '$operator' requires two operands.");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment