summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/functions.php12
1 files changed, 7 insertions, 5 deletions
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
+ }
}
}