Handle valid HTTP responses with no response body.
This commit is contained in:
parent
ed2cbeffcc
commit
57e31fe5a7
|
@ -462,7 +462,11 @@ class UrlHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$contents) {
|
if (!$contents) {
|
||||||
|
if (curl_errno($ch) === 0) {
|
||||||
|
self::$fetch_last_error = 'Successful response, but no content was received.';
|
||||||
|
} else {
|
||||||
self::$fetch_last_error = curl_errno($ch) . " " . curl_error($ch);
|
self::$fetch_last_error = curl_errno($ch) . " " . curl_error($ch);
|
||||||
|
}
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -578,6 +582,11 @@ class UrlHelper {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$data) {
|
||||||
|
self::$fetch_last_error = 'Successful response, but no content was received.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$is_gzipped = RSSUtils::is_gzipped($data);
|
$is_gzipped = RSSUtils::is_gzipped($data);
|
||||||
|
|
||||||
if ($is_gzipped && $data) {
|
if ($is_gzipped && $data) {
|
||||||
|
|
Loading…
Reference in New Issue