From: Mikael Nordfeldth Date: Fri, 29 Jan 2016 14:21:01 +0000 (+0100) Subject: Use the profile URI when linking instead of URL X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cb40f72c7e1bce35ee1d7e1ffea9a468d4a9a52b;p=quix0rs-gnu-social.git 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... --- 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())); }