]> git.mxchange.org Git - friendica.git/commitdiff
Prevent fatal error
authorMichael <heluecht@pirati.ca>
Thu, 11 Jul 2024 15:21:53 +0000 (15:21 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 11 Jul 2024 15:21:53 +0000 (15:21 +0000)
src/Content/Text/BBCode.php

index 21b866845b9c57b2df8bdb1d2428b4687ac6fc4f..24e1c426065f43ee532892ddbfe2168b7f3ce178 100644 (file)
@@ -1364,7 +1364,7 @@ class BBCode
                                // 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) {
                                        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);
                                });