We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d4cbc8d commit 664b451Copy full SHA for 664b451
src/Database/Validator/Operator.php
@@ -238,10 +238,14 @@ private function validateOperatorForAttribute(
238
case DatabaseOperator::TYPE_ARRAY_INTERSECT:
239
case DatabaseOperator::TYPE_ARRAY_DIFF:
240
if (!$isArray) {
241
- $this->message = "Cannot apply {$method} operator to non-array field '{$operator->getAttribute()}'";
+ $this->message = "Cannot use {$method} operator on non-array attribute '{$operator->getAttribute()}'";
242
return false;
243
}
244
245
+ if (empty($values) || !\is_array($values[0])) {
246
+ $this->message = "{$method} operator requires a non-empty array value";
247
+ return false;
248
+ }
249
250
break;
251
case DatabaseOperator::TYPE_ARRAY_FILTER:
0 commit comments