From 6b9a8b7b199991f4f26f3460fda85f8f59adbbd3 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Tue, 2 Jun 2015 13:45:22 +0200 Subject: [PATCH] Reuse code from our classes, don't write own algorithms --- lib/util.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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();