From 1905242a16d4a2d61d20c18746581616fed779a0 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 30 Jun 2018 22:37:44 +0000 Subject: [PATCH] Added support for internal Diaspora links to accounts --- src/Content/Text/BBCode.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 35f4979d11..33b3503eca 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1380,6 +1380,13 @@ class BBCode extends BaseObject }, $text ); + $text = preg_replace_callback( + "&\[url=/people\?q\=(.*)\](.*)\[\/url\]&Usi", + function ($match) { + return "[url=" . System::baseUrl() . "/search?search=%40" . $match[1] . "]" . $match[2] . "[/url]"; + }, $text + ); + // Server independent link to posts and comments // See issue: https://github.com/diaspora/diaspora_federation/issues/75 $expression = "=diaspora://.*?/post/([0-9A-Za-z\-_@.:]{15,254}[0-9A-Za-z])=ism";