]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Reuse code from our classes, don't write own algorithms
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 2 Jun 2015 11:45:22 +0000 (13:45 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 2 Jun 2015 11:45:22 +0000 (13:45 +0200)
lib/util.php

index cafe209a74f653939883bd65ccd6f5037311c639..395fadfbd7bcf35010ccaa993bbdee9de51e832f 100644 (file)
@@ -697,11 +697,8 @@ function common_linkify_mention(array $mention)
  */
 function common_find_mentions($text, Notice $notice)
 {
-    try {
-        $sender = Profile::getKV('id', $notice->profile_id);
-    } catch (NoProfileException $e) {
-        return array();
-    }
+    // The getProfile call throws NoProfileException on failure
+    $sender = $notice->getProfile();
 
     $mentions = array();