Merge pull request #9681 from annando/fatal-php8

Quit when message is empty
This commit is contained in:
Hypolite Petovan 2020-12-19 21:13:38 -05:00 committed by GitHub
commit 5649861fde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -188,6 +188,10 @@ class HTML
$message = str_replace(["\n<", ">\n", "\r", "\n", "\xC3\x82\xC2\xA0"], ["<", ">", "<br />", " ", ""], $message);
$message = preg_replace('= [\s]*=i', " ", $message);
if (empty($message)) {
return '';
}
@$doc->loadHTML($message, LIBXML_HTML_NODEFDTD);
self::tagToBBCode($doc, 'html', [], "", "");