fetch: check if http_response_header is set
This commit is contained in:
parent
48c1d0c71b
commit
37ddf5b7e7
|
@ -407,7 +407,7 @@
|
||||||
$data = @file_get_contents($url, false, $context);
|
$data = @file_get_contents($url, false, $context);
|
||||||
|
|
||||||
$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
|
||||||
if (is_array($http_response_header)) {
|
if (isset($http_response_header) && is_array($http_response_header)) {
|
||||||
foreach ($http_response_header as $h) {
|
foreach ($http_response_header as $h) {
|
||||||
if (substr(strtolower($h), 0, 13) == 'content-type:') {
|
if (substr(strtolower($h), 0, 13) == 'content-type:') {
|
||||||
$fetch_last_content_type = substr($h, 14);
|
$fetch_last_content_type = substr($h, 14);
|
||||||
|
|
Loading…
Reference in New Issue