Url::remove_trailing_slash(): improve method
This commit is contained in:
parent
bc54dd93e2
commit
4fae41d1ea
1 changed files with 1 additions and 3 deletions
|
@ -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, '/');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue