File tree 1 file changed +3
-16
lines changed
lib/internal/Magento/Framework/Filesystem/Driver 1 file changed +3
-16
lines changed Original file line number Diff line number Diff line change @@ -27,31 +27,18 @@ class Http extends File
27
27
*
28
28
* @param string $path
29
29
* @return bool
30
- * @throws FileSystemException
31
30
*/
32
31
public function isExists ($ path )
33
32
{
34
33
$ headers = array_change_key_case (get_headers ($ this ->getScheme () . $ path , 1 ), CASE_LOWER );
35
-
36
34
$ status = $ headers [0 ];
37
35
38
- /* Handling 302 redirection */
39
- if (strpos ($ status , '302 Found ' ) !== false && isset ($ headers [1 ])) {
40
- $ status = $ headers [1 ];
41
- }
42
-
43
- /* Handling 301 redirection */
44
- if (strpos ($ status , '301 Moved Permanently ' ) !== false && isset ($ headers [1 ])) {
36
+ /* Handling 301 or 302 redirection */
37
+ if (isset ($ headers [1 ]) && preg_match ('/^30[12]/ ' , $ status )) {
45
38
$ status = $ headers [1 ];
46
39
}
47
40
48
- if (strpos ($ status , '200 OK ' ) === false ) {
49
- $ result = false ;
50
- } else {
51
- $ result = true ;
52
- }
53
-
54
- return $ result ;
41
+ return !(strpos ($ status , '200 OK ' ) === false );
55
42
}
56
43
57
44
/**
You can’t perform that action at this time.
0 commit comments