File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
lib/internal/Magento/Framework/Filesystem/Directory Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -59,14 +59,18 @@ public function validate(
59
59
$ path ,
60
60
$ scheme
61
61
);
62
+ if (!$ absolutePath ) {
63
+ $ actualPath = $ this ->driver ->getRealPathSafety ($ fullPath );
64
+ } else {
65
+ $ actualPath = $ this ->driver ->getRealPathSafety ($ path );
66
+ }
62
67
63
- // Bypass deny list if in exception list.
64
68
if (in_array ($ fullPath , $ this ->exceptionList , true )) {
65
69
return ;
66
70
}
67
71
68
72
foreach ($ this ->fileDenyList as $ file ) {
69
- $ baseName = pathinfo ($ fullPath , PATHINFO_BASENAME );
73
+ $ baseName = pathinfo ($ actualPath , PATHINFO_BASENAME );
70
74
if (str_contains ($ baseName , $ file ) || preg_match ('# ' . "\. " . $ file . '# ' , $ fullPath )) {
71
75
throw new ValidatorException (
72
76
new Phrase ('"%1" is not a valid file path ' , [$ path ])
You can’t perform that action at this time.
0 commit comments