diff options
author | Andrew Dolgov <[email protected]> | 2021-03-03 11:35:04 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-03-03 11:35:04 +0300 |
commit | 1aedd223061e1e49826ce292f5a4847012169239 (patch) | |
tree | 7a3a1fa2fd22a7621e345f1869ec242f4eeb3927 /classes/config.php | |
parent | 50087df16291af5b74e9fb78d497850730814c82 (diff) |
config::make_self_url() strip index.php etc
Diffstat (limited to 'classes/config.php')
-rw-r--r-- | classes/config.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/classes/config.php b/classes/config.php index 3e2ce2e45..ca93bb650 100644 --- a/classes/config.php +++ b/classes/config.php @@ -284,6 +284,8 @@ class Config { $proto = self::is_server_https() ? 'https' : 'http'; $self_url_path = $proto . '://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; + $self_url_path = preg_replace("/\w+\.php$/", "", $self_url_path); + if (substr($self_url_path, -1) === "/") { return substr($self_url_path, 0, -1); } else { |