File tree Expand file tree Collapse file tree 1 file changed +3
-16
lines changed
lib/internal/Magento/Framework/Filesystem/Driver Expand file tree Collapse file tree 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
2727 *
2828 * @param string $path
2929 * @return bool
30- * @throws FileSystemException
3130 */
3231 public function isExists ($ path )
3332 {
3433 $ headers = array_change_key_case (get_headers ($ this ->getScheme () . $ path , 1 ), CASE_LOWER );
35-
3634 $ status = $ headers [0 ];
3735
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 )) {
4538 $ status = $ headers [1 ];
4639 }
4740
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 );
5542 }
5643
5744 /**
You can’t perform that action at this time.
0 commit comments