From: Roland Häder Date: Thu, 16 Jun 2022 13:45:22 +0000 (+0200) Subject: Added check as suggested by @MrPetovan for empty $message. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=962b06bf41e773ace6c898df510043f3cda206f9;p=friendica.git Added check as suggested by @MrPetovan for empty $message. --- diff --git a/src/Content/Text/HTML.php b/src/Content/Text/HTML.php index 9a5b909256..9121087296 100644 --- a/src/Content/Text/HTML.php +++ b/src/Content/Text/HTML.php @@ -143,6 +143,14 @@ class HTML */ public static function toBBCode(string $message, string $basepath = ''): string { + /* + * Check if message is empty to prevent a lot code below being executed + * for just an empty message. + */ + if (empty($message)) { + return ''; + } + DI::profiler()->startRecording('rendering'); $message = str_replace("\r", "", $message);