]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Make use of variable preMention signal method
authorMikael Nordfeldth <mmn@hethane.se>
Thu, 10 Aug 2017 09:33:18 +0000 (11:33 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Thu, 10 Aug 2017 09:33:18 +0000 (11:33 +0200)
lib/util.php

index 07773a06f39d08f414ac27955f5a9c2f0dccd582..2273ef505363807caea69e45ebbdfc0946312ad6 100644 (file)
@@ -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);