Skip to content

Commit a4a5a32

Browse files
authored
AC-9509: Scheduled operation improvements
1 parent 5957a45 commit a4a5a32

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ public function validate(
5454
$actualPath = $this->driver->getRealPathSafety($path);
5555
}
5656

57-
if (mb_strpos($actualPath, $realDirectoryPath) !== 0
58-
&& rtrim($path, DIRECTORY_SEPARATOR) !== $realDirectoryPath
57+
if (preg_match('/(?:^-|\s-)/', $path)
58+
|| (
59+
mb_strpos($actualPath, $realDirectoryPath) !== 0
60+
&& rtrim($path, DIRECTORY_SEPARATOR) !== $realDirectoryPath
61+
)
5962
) {
6063
throw new ValidatorException(
6164
new Phrase(

0 commit comments

Comments
 (0)