Added check as suggested by @MrPetovan for empty $message.
This commit is contained in:
parent
f2b7326650
commit
962b06bf41
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user