Quickfix for hashtags in usernames in shared posts

This commit is contained in:
Michael 2021-07-02 04:34:49 +00:00
parent bb2ae2face
commit 9cf39dbf00
1 changed files with 4 additions and 0 deletions

View 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;