make_self_url: properly strip out GET params
This commit is contained in:
parent
8cf421e1fc
commit
74d7f88fae
|
@ -465,9 +465,11 @@ class Config {
|
||||||
/** generates reference self_url_path (no trailing slash) */
|
/** generates reference self_url_path (no trailing slash) */
|
||||||
static function make_self_url() : string {
|
static function make_self_url() : string {
|
||||||
$proto = self::is_server_https() ? 'https' : 'http';
|
$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("/\w+\.php(\?.*$)?$/", "", $self_url_path);
|
||||||
|
#$self_url_path = preg_replace("/(\?.*$)?$/", "", $self_url_path);
|
||||||
|
|
||||||
if (substr($self_url_path, -1) === "/") {
|
if (substr($self_url_path, -1) === "/") {
|
||||||
return substr($self_url_path, 0, -1);
|
return substr($self_url_path, 0, -1);
|
||||||
|
|
Loading…
Reference in New Issue