Skip to content

Commit 6af6f93

Browse files
committed
fix bug in matchesAny() that caused nested arrays to throw an exception
1 parent 72be1ca commit 6af6f93

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Support/Arr.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ public static function matchesAny($strings, array $values, bool $allowRegex = tr
4646
$strings = [$strings];
4747
}
4848

49-
return collect($strings)->map(function (string $str) use ($values, $allowRegex) {
50-
return self::matches($str, $values, $allowRegex);
49+
return collect($strings)->map(function ($str) use ($values, $allowRegex) {
50+
if (is_array($str)) {
51+
return self::matchesAny($str, $values, $allowRegex);
52+
}
53+
54+
return self::matches((string)$str, $values, $allowRegex);
5155
})->filter(function ($value) {
5256
return $value;
5357
})->count() > 0;

0 commit comments

Comments
 (0)