From: Andrew Dolgov Date: Fri, 19 Apr 2013 05:48:09 +0000 (+0400) Subject: check if http_response_header is defined X-Git-Tag: 1.7.9~25^2~128 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=df25e4d221d20d358132c06510b23c852072d557;p=tt-rss.git check if http_response_header is defined --- diff --git a/include/functions.php b/include/functions.php index 0908bf8d..4cc8f134 100644 --- a/include/functions.php +++ b/include/functions.php @@ -394,11 +394,13 @@ $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 + } } }