forked from GNUsocial/gnu-social
Don't replace URLs if 'shortened' version is longer, unless forced
This commit is contained in:
parent
a1fd6e0fa4
commit
540c545399
@ -2163,7 +2163,11 @@ function common_shorten_url($long_url, User $user=null, $force = false)
|
|||||||
} else {
|
} else {
|
||||||
$shortenedUrl = common_local_url('redirecturl',
|
$shortenedUrl = common_local_url('redirecturl',
|
||||||
array('id' => $f->id));
|
array('id' => $f->id));
|
||||||
return $shortenedUrl;
|
if ((mb_strlen($shortenedUrl) < mb_strlen($long_url)) || $force) {
|
||||||
|
return $shortenedUrl;
|
||||||
|
} else {
|
||||||
|
return $long_url;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return $long_url;
|
return $long_url;
|
||||||
|
Loading…
Reference in New Issue
Block a user