1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-05 08:07:33 +02:00

Error handling in ExplosmBridge (#4600)

Skip further processing if element was not found to avoid errors
This commit is contained in:
Sebastian K
2025-08-03 23:58:24 +02:00
committed by GitHub
parent 8e880de3d2
commit c90b98b965

View File

@@ -36,6 +36,9 @@ class ExplosmBridge extends BridgeAbstract
$html = getSimpleHTMLDOM($url); $html = getSimpleHTMLDOM($url);
$element = $html->find('[class*=ComicImage]', 0); $element = $html->find('[class*=ComicImage]', 0);
if(!$element) {
break; // skip, if element was not found
}
$date = $element->find('[class^=Author__Right] p', 0)->plaintext; $date = $element->find('[class^=Author__Right] p', 0)->plaintext;
$author = str_replace('by ', '', $element->find('[class^=Author__Right] p', 1)->plaintext); $author = str_replace('by ', '', $element->find('[class^=Author__Right] p', 1)->plaintext);
$image = $element->find('img', 0)->src; $image = $element->find('img', 0)->src;