summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-04-19 09:48:09 +0400
committerAndrew Dolgov <[email protected]>2013-04-19 09:48:09 +0400
commitdf25e4d221d20d358132c06510b23c852072d557 (patch)
treea20e2b9fd5d842f3f3fa9242e094236a9553f2d4 /include
parentb367c951b990b38677e67f1a1756cd4d1eaee50b (diff)
check if http_response_header is defined
Diffstat (limited to 'include')
-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
+ }
}
}