Prevent fatal error

This commit is contained in:
Michael 2024-07-11 15:21:53 +00:00
parent d63edf5dfa
commit a9e2a02312

View file

@ -1364,7 +1364,7 @@ class BBCode
// At a later stage we won't be able to exclude certain parts of the code. // At a later stage we won't be able to exclude certain parts of the code.
$text = self::performWithEscapedTags($text, ['url', 'img', 'audio', 'video', 'youtube', 'vimeo', 'share', 'attachment', 'iframe', 'bookmark', 'map', 'oembed'], function ($text) use ($simple_html, $for_plaintext) { $text = self::performWithEscapedTags($text, ['url', 'img', 'audio', 'video', 'youtube', 'vimeo', 'share', 'attachment', 'iframe', 'bookmark', 'map', 'oembed'], function ($text) use ($simple_html, $for_plaintext) {
if (!$for_plaintext) { if (!$for_plaintext) {
$text = preg_replace(Strings::autoLinkRegEx(), '[url]$1[/url]', $text); $text = preg_replace(Strings::autoLinkRegEx(), '[url]$1[/url]', $text) ?? '';
} }
return self::convertSmileysToHtml($text, $simple_html, $for_plaintext); return self::convertSmileysToHtml($text, $simple_html, $for_plaintext);
}); });