We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5957a45 commit a4a5a32Copy full SHA for a4a5a32
lib/internal/Magento/Framework/Filesystem/Directory/PathValidator.php
@@ -54,8 +54,11 @@ public function validate(
54
$actualPath = $this->driver->getRealPathSafety($path);
55
}
56
57
- if (mb_strpos($actualPath, $realDirectoryPath) !== 0
58
- && rtrim($path, DIRECTORY_SEPARATOR) !== $realDirectoryPath
+ if (preg_match('/(?:^-|\s-)/', $path)
+ || (
59
+ mb_strpos($actualPath, $realDirectoryPath) !== 0
60
+ && rtrim($path, DIRECTORY_SEPARATOR) !== $realDirectoryPath
61
+ )
62
) {
63
throw new ValidatorException(
64
new Phrase(
0 commit comments