]> git.mxchange.org Git - friendica.git/commitdiff
Quickfix for hashtags in usernames in shared posts
authorMichael <heluecht@pirati.ca>
Fri, 2 Jul 2021 04:34:49 +0000 (04:34 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 2 Jul 2021 04:34:49 +0000 (04:34 +0000)
src/Content/Text/BBCode.php

index 6d41cd85cc1a19a9e5c0fe2bd2613884c3c625f4..634ea9aac01648474bdf92b1db2084b3b612d56a 100644 (file)
@@ -953,6 +953,10 @@ class BBCode
         */
        public static function fetchShareAttributes($text)
        {
+               // See Issue https://github.com/friendica/friendica/issues/10454
+               // Hashtags in usernames are expanded to links. This here is a quick fix. 
+               $text = preg_replace('/([@!#])\[url\=.*?\](.*?)\[\/url\]/ism', '$1$2', $text);
+
                $attributes = [];
                if (!preg_match("/(.*?)\[share(.*?)\](.*)\[\/share\]/ism", $text, $matches)) {
                        return $attributes;