]> git.mxchange.org Git - friendica.git/commitdiff
Simplify BBCode::toPlaintext
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 27 May 2019 16:02:12 +0000 (12:02 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 27 May 2019 16:02:12 +0000 (12:02 -0400)
- Keep white spaces after tags

src/Content/Text/BBCode.php

index e417b38a467b8cbb8ed096a8f9d153e3cb5ce10a..c4735b9e936cf3decc4c463b558ef7f0060cb811 100644 (file)
@@ -355,7 +355,7 @@ class BBCode extends BaseObject
         */
        public static function toPlaintext($text, $keep_urls = true)
        {
-               $naked_text = preg_replace('/\[(.+?)\]\s*/','', $text);
+               $naked_text = preg_replace('/\[.+?\]/','', $text);
                if (!$keep_urls) {
                        $naked_text = preg_replace('#https?\://[^\s<]+[^\s\.\)]#i', '', $naked_text);
                }