From 00cbc852b0ee0e026a6a5d59a1c567079256d607 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Thu, 10 Aug 2017 11:33:18 +0200 Subject: [PATCH] Make use of variable preMention signal method --- lib/util.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/util.php b/lib/util.php index 07773a06f3..2273ef5053 100644 --- a/lib/util.php +++ b/lib/util.php @@ -847,9 +847,8 @@ function common_find_mentions($text, Profile $sender, Notice $parent=null) 'url' => $url); } - preg_match_all('/'.Nickname::BEFORE_MENTIONS.'!(' . Nickname::DISPLAY_FMT . ')/', - $text, $hmatches, PREG_OFFSET_CAPTURE); - foreach ($hmatches[1] as $hmatch) { + $hmatches = common_find_mentions_raw($text, '!'); + foreach ($hmatches as $hmatch) { $nickname = Nickname::normalize($hmatch[0]); $group = User_group::getForNickname($nickname, $sender);