fix get_self_url() misbehaving in plugins/

This commit is contained in:
Andrew Dolgov
2024-11-04 13:59:02 +03:00
parent d8718b7574
commit 42ebdb027e
2 changed files with 13 additions and 1 deletions

View File

@@ -483,7 +483,7 @@ class Config {
$self_url_path = $proto . '://' . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
$self_url_path = preg_replace("/(\/api\/{1,})?(\w+\.php)?(\?.*$)?$/", "", $self_url_path);
$self_url_path = preg_replace("/(\/plugins(.local))\/.{1,}$/", "", $self_url_path);
$self_url_path = preg_replace("/(\/plugins(.local)?)\/.{1,}$/", "", $self_url_path);
return rtrim($self_url_path, "/");
}