From: Mikael Nordfeldth Date: Tue, 2 Jun 2015 11:45:22 +0000 (+0200) Subject: Reuse code from our classes, don't write own algorithms X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6b9a8b7b199991f4f26f3460fda85f8f59adbbd3;p=quix0rs-gnu-social.git Reuse code from our classes, don't write own algorithms --- diff --git a/lib/util.php b/lib/util.php index cafe209a74..395fadfbd7 100644 --- a/lib/util.php +++ b/lib/util.php @@ -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();