From: Michael Date: Fri, 17 Mar 2023 12:33:13 +0000 (+0000) Subject: Only add paragraphs if needed X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=dfaf3eee6bb6ec33eb58be5eeb4fea16acc955a5;p=friendica.git Only add paragraphs if needed --- diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index c9bbc02c93..609e4ef52e 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -36,14 +36,10 @@ use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Event; -use Friendica\Model\Photo; use Friendica\Model\Post; use Friendica\Model\Tag; use Friendica\Network\HTTPClient\Client\HttpClientAccept; use Friendica\Network\HTTPClient\Client\HttpClientOptions; -use Friendica\Object\Image; -use Friendica\Protocol\Activity; -use Friendica\Util\Images; use Friendica\Util\Map; use Friendica\Util\ParseUrl; use Friendica\Util\Proxy; @@ -1939,7 +1935,11 @@ class BBCode : [] ); - $text = HTML::purify('

' . $text . '

', $allowedIframeDomains); + if (strpos($text, '

') !== false || strpos($text, '

') !== false) { + $text = '

' . $text . '

'; + } + + $text = HTML::purify($text, $allowedIframeDomains); DI::profiler()->stopRecording(); return trim($text);