forked from GNUsocial/gnu-social
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...
This commit is contained in:
parent
5b11238010
commit
cb40f72c7e
@ -771,7 +771,10 @@ function common_find_mentions($text, Profile $sender, Notice $parent=null)
|
|||||||
|
|
||||||
if ($mentioned instanceof Profile) {
|
if ($mentioned instanceof Profile) {
|
||||||
try {
|
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) {
|
} catch (InvalidUrlException $e) {
|
||||||
$url = common_local_url('userbyid', array('id' => $mentioned->getID()));
|
$url = common_local_url('userbyid', array('id' => $mentioned->getID()));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user