]> git.mxchange.org Git - friendica.git/commitdiff
Issue 11846: Fix client behaviour when following hash tags
authorMichael <heluecht@pirati.ca>
Sat, 5 Nov 2022 22:35:35 +0000 (22:35 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 5 Nov 2022 22:35:35 +0000 (22:35 +0000)
src/Content/Text/BBCode.php
src/Object/Api/Mastodon/Status.php

index e8a396a35a90c41cf3679bacf2c14f00f5699728..86d8c6ac8759bc6923125c7023ea5a5a6f8c8a2c 100644 (file)
@@ -1975,6 +1975,9 @@ class BBCode
                                        $text = preg_replace("/([@!])\[url\=(.*?)\](.*?)\[\/url\]/ism",
                                                '<bdi>$1<a href="$2" class="userinfo mention" title="$3">$3</a></bdi>',
                                                $text);
+                                       $text = preg_replace("/([#])\[url\=(.*?)\](.*?)\[\/url\]/ism",
+                                               '<a class="mention hashtag status-link" href="$2" rel="tag">$1<span>$3</span></a>',
+                                               $text);
                                } else {
                                        $text = preg_replace("/([#@!])\[url\=(.*?)\](.*?)\[\/url\]/ism", '$1$3', $text);
                                }
index ced6919649714222e06f43e6190643a06413dc95..b0832f0c34821296a2457f1248e71e5d9cb82e51 100644 (file)
@@ -109,7 +109,7 @@ class Status extends BaseDataTransferObject
                }
 
                $this->sensitive    = $sensitive;
-               $this->spoiler_text = $item['title'] ?: $item['content-warning'];
+               $this->spoiler_text = ($item['title'] ?: $item['content-warning']) ?: '';
 
                $visibility = ['public', 'private', 'unlisted'];
                $this->visibility = $visibility[$item['private']];