forked from blallo/rss-bridge
Handle failing requests
Disabling https support results in a failed request which is now handled as if there is no data at all.
This commit is contained in:
parent
01bdda5e19
commit
d0c932c149
1 changed files with 6 additions and 1 deletions
|
@ -10,6 +10,11 @@ class CADBridge extends BridgeAbstract{
|
||||||
|
|
||||||
function CADExtractContent($url) {
|
function CADExtractContent($url) {
|
||||||
$html3 = $this->file_get_html($url);
|
$html3 = $this->file_get_html($url);
|
||||||
|
|
||||||
|
// The request might fail due to missing https support or wrong URL
|
||||||
|
if($html3 == false)
|
||||||
|
return 'Daily comic not released yet';
|
||||||
|
|
||||||
$htmlpart = explode("/", $url);
|
$htmlpart = explode("/", $url);
|
||||||
if ($htmlpart[3] == 'cad')
|
if ($htmlpart[3] == 'cad')
|
||||||
preg_match_all("/http:\/\/cdn2\.cad-comic\.com\/comics\/cad-\S*png/", $html3, $url2);
|
preg_match_all("/http:\/\/cdn2\.cad-comic\.com\/comics\/cad-\S*png/", $html3, $url2);
|
||||||
|
@ -19,7 +24,7 @@ class CADBridge extends BridgeAbstract{
|
||||||
$html3->clear();
|
$html3->clear();
|
||||||
unset ($html3);
|
unset ($html3);
|
||||||
if ($img == '')
|
if ($img == '')
|
||||||
return 'Daily comic not realease yet';
|
return 'Daily comic not released yet';
|
||||||
return '<img src="'.$img.'"/>';
|
return '<img src="'.$img.'"/>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue