Skip to content

Commit cda98b5

Browse files
authored
Replaced PHP8-only str_contains method
Fix after code review
1 parent 5888eea commit cda98b5

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 ('' === $needle || false !== strpos($haystack, $needle) || preg_match('#' . "\." . $file . '#', $fullPath)) {
74+
if ('' === $file || false !== strpos($baseName, $file) || 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)