Skip to content

Commit dfb2e2a

Browse files
author
hwyu@adobe.com
committed
MC-41488: Directory write update
- Added extra validation
1 parent c03f6ce commit dfb2e2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public function validate(
6666
}
6767

6868
foreach ($this->fileDenyList as $file) {
69-
$ext = pathinfo($fullPath, PATHINFO_EXTENSION);
70-
if ($ext == $file) {
69+
$baseName = pathinfo($fullPath, PATHINFO_BASENAME);
70+
if (str_contains($baseName, $file) || preg_match('#' . "\." . $file . '#', $fullPath)) {
7171
throw new ValidatorException(
7272
new Phrase('"%1" is not a valid file path', [$path])
7373
);

0 commit comments

Comments
 (0)