From 94c49399cc10c1f7001e8c76db7575b70e1fc674 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 28 Nov 2022 19:24:12 +0300 Subject: get_self_url: strip all trailing slashes --- classes/config.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'classes/config.php') 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 { -- cgit v1.2.3-54-g00ecf