From df25e4d221d20d358132c06510b23c852072d557 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 19 Apr 2013 09:48:09 +0400 Subject: check if http_response_header is defined --- include/functions.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 0908bf8d3..4cc8f134d 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 + } } } -- cgit v1.2.3