Reuse code from our classes, don't write own algorithms

This commit is contained in:
Mikael Nordfeldth 2015-06-02 13:45:22 +02:00
parent e728e2aa81
commit 6b9a8b7b19

View File

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