diff --git a/phpBB/common.php b/phpBB/common.php index 5518fb6f0a..4fab61ca67 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -51,10 +51,10 @@ if (!defined('PHPBB_INSTALLED')) $server_port = 443; } - $script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF'); + $script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI'); if (!$script_name) { - $script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI'); + $script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF'); } // $phpbb_root_path accounts for redirects from e.g. /adm diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 27865cbe54..fa47c50b49 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -427,7 +427,7 @@ class messenger $user->session_begin(); } - $calling_page = html_entity_decode($request->server('PHP_SELF'), ENT_COMPAT); + $calling_page = html_entity_decode($request->server('REQUEST_URI'), ENT_COMPAT); switch ($type) { diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php index 002bd9b331..7116ab49d4 100644 --- a/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php +++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php @@ -65,11 +65,11 @@ class obtain_server_data extends \phpbb\install\task_base implements \phpbb\inst $server_name = substr($server_name, 0, strpos($server_name, ':')); } - $script_path = html_entity_decode($this->io_handler->get_server_variable('PHP_SELF'), ENT_COMPAT); + $script_path = html_entity_decode($this->io_handler->get_server_variable('REQUEST_URI'), ENT_COMPAT); if (!$script_path) { - $script_path = html_entity_decode($this->io_handler->get_server_variable('REQUEST_URI'), ENT_COMPAT); + $script_path = html_entity_decode($this->io_handler->get_server_variable('PHP_SELF'), ENT_COMPAT); } $script_path = str_replace(array('\\', '//'), '/', $script_path);