1
0
Fork 0
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:
logmanoriginal 2016-08-02 14:07:40 +02:00
parent 01bdda5e19
commit d0c932c149

View file

@ -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.'"/>';
} }