diff --git a/src/Content/Text/HTML.php b/src/Content/Text/HTML.php index 8223aa183..975be8b1f 100644 --- a/src/Content/Text/HTML.php +++ b/src/Content/Text/HTML.php @@ -167,6 +167,10 @@ class HTML $message = mb_convert_encoding($message, 'HTML-ENTITIES', "UTF-8"); + if (empty($message)) { + return ''; + } + @$doc->loadHTML($message, LIBXML_HTML_NODEFDTD); XML::deleteNode($doc, 'style'); @@ -588,6 +592,10 @@ class HTML $message = mb_convert_encoding($message, 'HTML-ENTITIES', "UTF-8"); + if (empty($message)) { + return ''; + } + @$doc->loadHTML($message, LIBXML_HTML_NODEFDTD); $message = $doc->saveHTML(); diff --git a/src/Network/Probe.php b/src/Network/Probe.php index f4ca0398a..23eaf299c 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -1754,6 +1754,10 @@ class Probe */ public static function getFeedLink(string $url, string $body) { + if (empty($body)) { + return ''; + } + $doc = new DOMDocument(); if (!@$doc->loadHTML($body)) { return false;