From aa2b4e15a3beae536c35ec7ca9893b8154a6e87a Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 5 Nov 2022 22:35:35 +0000 Subject: [PATCH] Issue 11846: Fix client behaviour when following hash tags --- src/Content/Text/BBCode.php | 3 +++ src/Object/Api/Mastodon/Status.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index e8a396a35..86d8c6ac8 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1975,6 +1975,9 @@ class BBCode $text = preg_replace("/([@!])\[url\=(.*?)\](.*?)\[\/url\]/ism", '$1$3', $text); + $text = preg_replace("/([#])\[url\=(.*?)\](.*?)\[\/url\]/ism", + '', + $text); } else { $text = preg_replace("/([#@!])\[url\=(.*?)\](.*?)\[\/url\]/ism", '$1$3', $text); } diff --git a/src/Object/Api/Mastodon/Status.php b/src/Object/Api/Mastodon/Status.php index ced691964..b0832f0c3 100644 --- a/src/Object/Api/Mastodon/Status.php +++ b/src/Object/Api/Mastodon/Status.php @@ -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']];