Skip to content

Commit 5888eea

Browse files
authored
Check if needle is empty before using strpos.
1 parent 055d9fc commit 5888eea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/Magento/Framework/Filesystem/Directory/DenyListPathValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function validate(
7171

7272
foreach ($this->fileDenyList as $file) {
7373
$baseName = pathinfo($actualPath, PATHINFO_BASENAME);
74-
if (stripos($baseName, $file) !== false || preg_match('#' . "\." . $file . '#', $fullPath)) {
74+
if ('' === $needle || false !== strpos($haystack, $needle) || preg_match('#' . "\." . $file . '#', $fullPath)) {
7575
throw new ValidatorException(
7676
new Phrase('"%1" is not a valid file path', [$path])
7777
);

0 commit comments

Comments
 (0)