diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2024-09-15 07:17:48 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2024-09-15 07:17:48 +0300 |
| commit | 0163884ef61bca4268621ef948b8cf21360b7b7f (patch) | |
| tree | 4262ebdcf63d54bfe5bdc80be7395d409e98b4c2 /classes/Config.php | |
| parent | 9c44af354fd99d1bb24c09f5bd8b2b2b4d5a6104 (diff) | |
add another test for self url, split regex into two parts - one for plugins, one for everything else
Diffstat (limited to 'classes/Config.php')
| -rw-r--r-- | classes/Config.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/classes/Config.php b/classes/Config.php index be9dd04e8..e9d44063c 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -490,7 +490,8 @@ class Config { $proto = self::is_server_https() ? 'https' : 'http'; $self_url_path = $proto . '://' . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); - $self_url_path = preg_replace("/(\/api\/{1,}|\/plugins(.local)?\/.{1,}\/{1,})?(\w+\.php)?(\?.*$)?$/", "", $self_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); return rtrim($self_url_path, "/"); } |