Avoid HTML parsing of an empty body

This commit is contained in:
Michael 2021-04-10 05:46:19 +00:00
parent 3e2fa7867c
commit 5a00902e11
7 changed files with 26 additions and 9 deletions

View file

@ -98,7 +98,7 @@ class OEmbed
if (!in_array($ext, $noexts)) {
// try oembed autodiscovery
$html_text = DI::httpRequest()->fetch($embedurl, 15, 'text/*');
if ($html_text) {
if (!empty($html_text)) {
$dom = new DOMDocument();
if (@$dom->loadHTML($html_text)) {
$xpath = new DOMXPath($dom);