]> git.wh0rd.org - tt-rss.git/commitdiff
check if http_response_header is defined
authorAndrew Dolgov <fox@fakecake.org>
Fri, 19 Apr 2013 05:48:09 +0000 (09:48 +0400)
committerAndrew Dolgov <fox@fakecake.org>
Fri, 19 Apr 2013 05:48:09 +0000 (09:48 +0400)
include/functions.php

index 0908bf8d38c34ec6488b454c053ad7b03593dc55..4cc8f134da6962b90557ba9507cad915d6701ca5 100644 (file)
                        $data = @file_get_contents($url);
 
                        $fetch_last_content_type = false;  // reset if no type was sent from server
-                       foreach ($http_response_header as $h) {
-                               if (substr(strtolower($h), 0, 13) == 'content-type:') {
-                                       $fetch_last_content_type = substr($h, 14);
-                                       // don't abort here b/c there might be more than one
-                                       // e.g. if we were being redirected -- last one is the right one
+                       if (is_array($http_response_header)) {
+                               foreach ($http_response_header as $h) {
+                                       if (substr(strtolower($h), 0, 13) == 'content-type:') {
+                                               $fetch_last_content_type = substr($h, 14);
+                                               // don't abort here b/c there might be more than one
+                                               // e.g. if we were being redirected -- last one is the right one
+                                       }
                                }
                        }