fix: various bug fixes (#3102)

* fix: Undefined offset: 4

* fix: Trying to access array offset on value of type bool

* fix: Undefined variable: photo at bridges/TelegramBridge.php line 287

* fix: Trying to get property innertext of non-object at bridges/ZDNetBridge.php line 186

* fix: Undefined index: Category at bridges/UnraidCommunityApplicationsBridge.php line 42

* fix: Undefined index: fullUrl at bridges/EuronewsBridge.php line 61
This commit is contained in:
Dag 2022-10-16 20:26:33 +02:00 committed by GitHub
parent ffbc107687
commit 37f1ab726b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 82 additions and 71 deletions

View file

@ -282,12 +282,16 @@ EOD;
preg_match($this->backgroundImageRegex, $messageDiv->find('i.link_preview_video_thumb', 0)->style, $photo);
} elseif ($messageDiv->find('i.tgme_widget_message_roundvideo_thumb')) {
preg_match($this->backgroundImageRegex, $messageDiv->find('i.tgme_widget_message_roundvideo_thumb', 0)->style, $photo);
} else {
// Not all videos have a poster image
$photo = [null, null];
}
$this->enclosures[] = $photo[1];
// Intentionally omitting preload="none" on <video>
return <<<EOD
<video controls="" poster="{$photo[1]}" style="max-width:100%;" preload="none">
<video controls="" poster="{$photo[1]}" style="max-width:100%;">
<source src="{$messageDiv->find('video', 0)->src}" type="video/mp4">
</video>
EOD;