diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index e8a396a35..2ed4e57b3 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1305,7 +1305,7 @@ class BBCode /** * Callback: Expands links from given $match array * - * @param arrat $match Array with link match + * @param array $match Array with link match * @return string BBCode */ private static function expandLinksCallback(array $match): string @@ -1320,7 +1320,7 @@ class BBCode /** * Callback: Cleans picture links * - * @param arrat $match Array with link match + * @param array $match Array with link match * @return string BBCode */ private static function cleanPictureLinksCallback(array $match): string @@ -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..8ba99ebfa 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']];