1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-11 19:14:09 +02:00

fix: php errors (notices) (#3115)

This commit is contained in:
Dag
2022-10-26 00:47:45 +02:00
committed by GitHub
parent 8795cb252f
commit 52af2ae34c
9 changed files with 33 additions and 20 deletions

View File

@@ -26,9 +26,10 @@ class NasaApodBridge extends BridgeAbstract
//Extract image and explanation
$image_wrapper = $picture_html->find('a', 1);
$image_path = $image_wrapper->href;
// This image is not present when youtube embed
$img_placeholder = $image_wrapper->find('img', 0);
$img_alt = $img_placeholder->alt;
$img_style = $img_placeholder->style;
$img_alt = $img_placeholder->alt ?? '';
$img_style = $img_placeholder->style ?? '';
$image_uri = self::URI . $image_path;
$new_img_placeholder = "<img src=\"$image_uri\" alt=\"$img_alt\" style=\"$img_style\">";
$media = "<a href=\"$image_uri\">$new_img_placeholder</a>";