1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/12785] Prefer REQUEST_URI over PHP_SELF in early redirects

PHPBB3-12785
This commit is contained in:
Marc Alexander
2023-09-16 12:02:39 +02:00
parent bdbbc63b9c
commit d572070456
3 changed files with 5 additions and 5 deletions

View File

@@ -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

View File

@@ -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)
{

View File

@@ -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);