From 9cf39dbf007b794d1ae635683172ea9d2370d849 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 2 Jul 2021 04:34:49 +0000 Subject: [PATCH] Quickfix for hashtags in usernames in shared posts --- src/Content/Text/BBCode.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 6d41cd85cc..634ea9aac0 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -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;