]> git.mxchange.org Git - friendica.git/commitdiff
Added check as suggested by @MrPetovan for empty $message.
authorRoland Häder <roland@mxchange.org>
Thu, 16 Jun 2022 13:45:22 +0000 (15:45 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 16 Jun 2022 14:54:51 +0000 (16:54 +0200)
src/Content/Text/HTML.php

index 9a5b9092561987acb416d659fe8f650fb1e14289..9121087296a977d539e89018546af79c822615d0 100644 (file)
@@ -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);