Moved the share interpretation

This commit is contained in:
Michael 2022-10-07 07:41:03 +00:00
parent 1ef5730d3d
commit ef934db614
2 changed files with 17 additions and 13 deletions

View file

@ -1021,6 +1021,19 @@ class BBCode
public static function fetchShareAttributes(string $text): array
{
DI::profiler()->startRecording('rendering');
if (preg_match('#(.*?)\[share](.*)\[/share]#', $text, $matches)) {
return [
'author' => '',
'profile' => '',
'avatar' => '',
'link' => '',
'posted' => '',
'guid' => '',
'message_id' => $matches[2],
'comment' => trim($matches[1]),
'shared' => '',
];
}
// 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);