1
0

FIx: Missing checks

This commit is contained in:
Richard Dern 2024-04-27 00:04:50 +02:00
parent 6472a36fed
commit 04655146f3
2 changed files with 6 additions and 2 deletions

View File

@ -100,7 +100,7 @@ public static function handles(Bundle $bundle): bool
{
$parts = preg_split('#/#', $bundle->getPath(), -1, PREG_SPLIT_NO_EMPTY);
if ($parts[0] !== 'critiques' || count($parts) !== 3) {
if (empty($parts) || $parts[0] !== 'critiques' || count($parts) !== 3) {
return false;
}

View File

@ -104,7 +104,11 @@ public static function handles(Bundle $bundle): bool
{
$parts = preg_split('#/#', $bundle->getPath(), -1, PREG_SPLIT_NO_EMPTY);
if ($parts[0] !== 'collections' || $parts[1] !== 'lego' || count($parts) !== 4) {
if (empty($parts)) {
return false;
}
if (empty($parts) || $parts[0] !== 'collections' || empty($parts[1]) || $parts[1] !== 'lego' || count($parts) !== 4) {
return false;
}