From cb40f72c7e1bce35ee1d7e1ffea9a468d4a9a52b Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Fri, 29 Jan 2016 15:21:01 +0100 Subject: [PATCH] Use the profile URI when linking instead of URL since we'll then get to /user/$id instead of /$nickname which is good for future archives if someone changes their nickname... --- lib/util.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/util.php b/lib/util.php index 4dd86fa370..b7eac68619 100644 --- a/lib/util.php +++ b/lib/util.php @@ -771,7 +771,10 @@ function common_find_mentions($text, Profile $sender, Notice $parent=null) if ($mentioned instanceof Profile) { try { - $url = $mentioned->getUrl(); + $url = $mentioned->getUri(); // prefer the URI as URL, if it is one. + if (!common_valid_http_url($url)) { + $url = $mentioned->getUrl(); + } } catch (InvalidUrlException $e) { $url = common_local_url('userbyid', array('id' => $mentioned->getID())); } -- 2.39.5