Url::remove_trailing_slash(): improve method

This commit is contained in:
Benjamin Renard 2023-02-26 23:41:55 +01:00
parent bc54dd93e2
commit 4fae41d1ea

View file

@ -472,9 +472,7 @@ class Url {
public static function remove_trailing_slash($url) {
if ($url == '/')
return $url;
elseif (substr($url, -1) == '/')
return substr($url, 0, -1);
return $url;
return rtrim($url, '/');
}
/**