Commit cb40f72c authored by mmn's avatar mmn

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...
parent 5b112380
......@@ -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()));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment