diff options
author | Andrew Dolgov <[email protected]> | 2022-11-28 19:24:12 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-11-28 19:24:12 +0300 |
commit | 94c49399cc10c1f7001e8c76db7575b70e1fc674 (patch) | |
tree | d5be976e4549b4ed36863fdb975a5101b6d8c33b /classes/config.php | |
parent | 52180c9f8f3c06b8bdfb942dd2aa2818e9dd41c6 (diff) |
get_self_url: strip all trailing slashes
Diffstat (limited to 'classes/config.php')
-rw-r--r-- | classes/config.php | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/classes/config.php b/classes/config.php index a4a42a60a..ab31bc860 100644 --- a/classes/config.php +++ b/classes/config.php @@ -448,13 +448,7 @@ class Config { /** this returns Config::SELF_URL_PATH sans trailing slash */ static function get_self_url() : string { - $self_url_path = self::get(Config::SELF_URL_PATH); - - if (substr($self_url_path, -1) === "/") { - return substr($self_url_path, 0, -1); - } else { - return $self_url_path; - } + return preg_replace("#/*$#", "", self::get(Config::SELF_URL_PATH)); } static function is_server_https() : bool { |