check if http_response_header is defined
This commit is contained in:
parent
b367c951b9
commit
df25e4d221
|
@ -394,11 +394,13 @@
|
||||||
$data = @file_get_contents($url);
|
$data = @file_get_contents($url);
|
||||||
|
|
||||||
$fetch_last_content_type = false; // reset if no type was sent from server
|
$fetch_last_content_type = false; // reset if no type was sent from server
|
||||||
foreach ($http_response_header as $h) {
|
if (is_array($http_response_header)) {
|
||||||
if (substr(strtolower($h), 0, 13) == 'content-type:') {
|
foreach ($http_response_header as $h) {
|
||||||
$fetch_last_content_type = substr($h, 14);
|
if (substr(strtolower($h), 0, 13) == 'content-type:') {
|
||||||
// don't abort here b/c there might be more than one
|
$fetch_last_content_type = substr($h, 14);
|
||||||
// e.g. if we were being redirected -- last one is the right one
|
// 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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue