We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 540c5453 authored by Evan Prodromou's avatar Evan Prodromou

Don't replace URLs if 'shortened' version is longer, unless forced

parent a1fd6e0f
......@@ -2163,7 +2163,11 @@ function common_shorten_url($long_url, User $user=null, $force = false)
} else {
$shortenedUrl = common_local_url('redirecturl',
array('id' => $f->id));
return $shortenedUrl;
if ((mb_strlen($shortenedUrl) < mb_strlen($long_url)) || $force) {
return $shortenedUrl;
} else {
return $long_url;
}
}
} else {
return $long_url;
......
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