Added check as suggested by @MrPetovan for empty $message.

This commit is contained in:
Roland Häder 2022-06-16 15:45:22 +02:00
parent f2b7326650
commit 962b06bf41
No known key found for this signature in database
GPG key ID: C82EDE5DDFA0BA77

View 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);