Skip to content

Commit 140c3a8

Browse files
committed
do not allow nested arrays in whereIn method
1 parent e89b2b0 commit 140c3a8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Illuminate/Database/Query/Builder.php

+4
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,10 @@ public function whereIn($column, $values, $boolean = 'and', $not = false)
10281028

10291029
$this->wheres[] = compact('type', 'column', 'values', 'boolean');
10301030

1031+
if (count($values) !== count(Arr::flatten($values, 1))) {
1032+
throw new InvalidArgumentException("Nested arrays may not be passed to whereIn method.");
1033+
}
1034+
10311035
// Finally, we'll add a binding for each value unless that value is an expression
10321036
// in which case we will just skip over it since it will be the query as a raw
10331037
// string and not as a parameterized place-holder to be replaced by the PDO.

0 commit comments

Comments
 (0)