summaryrefslogtreecommitdiff
path: root/classes/config.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2022-07-24 14:50:03 +0300
committerAndrew Dolgov <[email protected]>2022-07-24 14:50:03 +0300
commit74d7f88fae625f85a3d7677497605427d1d04d74 (patch)
treecff435a60a151d594438b6934edd15688d7cfa6b /classes/config.php
parent8cf421e1fcae66ee4a8ed6d8c007d26f501c0f1d (diff)
make_self_url: properly strip out GET params
Diffstat (limited to 'classes/config.php')
-rw-r--r--classes/config.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/classes/config.php b/classes/config.php
index 6ebe31e2d..afb182440 100644
--- a/classes/config.php
+++ b/classes/config.php
@@ -465,9 +465,11 @@ class Config {
/** generates reference self_url_path (no trailing slash) */
static function make_self_url() : string {
$proto = self::is_server_https() ? 'https' : 'http';
- $self_url_path = $proto . '://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
+
+ $self_url_path = $proto . '://' . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
$self_url_path = preg_replace("/\w+\.php(\?.*$)?$/", "", $self_url_path);
+ #$self_url_path = preg_replace("/(\?.*$)?$/", "", $self_url_path);
if (substr($self_url_path, -1) === "/") {
return substr($self_url_path, 0, -1);