From 3ec1270fde27787c6d81a36a3c13194506490f40 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 19 Dec 2020 18:17:32 +0000 Subject: [PATCH] Quit when message is empty --- src/Content/Text/HTML.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Content/Text/HTML.php b/src/Content/Text/HTML.php index 6f2d7c7905..c3c43822ab 100644 --- a/src/Content/Text/HTML.php +++ b/src/Content/Text/HTML.php @@ -188,6 +188,10 @@ class HTML $message = str_replace(["\n<", ">\n", "\r", "\n", "\xC3\x82\xC2\xA0"], ["<", ">", "
", " ", ""], $message); $message = preg_replace('= [\s]*=i', " ", $message); + if (empty($message)) { + return ''; + } + @$doc->loadHTML($message, LIBXML_HTML_NODEFDTD); self::tagToBBCode($doc, 'html', [], "", "");