diff options
author | Andrew Dolgov <[email protected]> | 2023-10-23 23:39:28 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2023-10-23 23:39:28 +0300 |
commit | 1e3b7f7a43819f03c5efa5078e102d664fb7917a (patch) | |
tree | a301dd0e7cecd0486524250867a57e1d973b76b3 /classes | |
parent | 994f376f42cd0691f4dc73940057915ad2d4d9b9 (diff) |
Revert "add a self url path hack to strip request path directories (needed for /api/index.php)"
This reverts commit 9826d2f07527e3259957628030adc87bde391b0c.
Diffstat (limited to 'classes')
-rw-r--r-- | classes/config.php | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/classes/config.php b/classes/config.php index 77795de7a..17c555fa9 100644 --- a/classes/config.php +++ b/classes/config.php @@ -268,8 +268,6 @@ class Config { /** @var Db_Migrations|null $migrations */ private $migrations; - private static $self_url_path_strip_dirs = 0; - public static function get_instance() : Config { if (self::$instance == null) self::$instance = new self(); @@ -478,10 +476,6 @@ class Config { (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'); } - static function strip_self_url_path_dirs($amount) { - self::$self_url_path_strip_dirs = $amount; - } - /** returns fully-qualified external URL to tt-rss (no trailing slash) * SELF_URL_PATH configuration variable is used as a fallback for the CLI SAPI * */ @@ -494,9 +488,6 @@ class Config { $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); - for ($i = 0; $i < self::$self_url_path_strip_dirs; $i++) - $self_url_path = dirname($self_url_path); - if (substr($self_url_path, -1) === "/") { return substr($self_url_path, 0, -1); } else { |