1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-10 18:54:08 +02:00

Merge branch '3.3.x'

This commit is contained in:
Marc Alexander
2023-10-31 20:24:59 +01:00
3 changed files with 95 additions and 12 deletions

View File

@@ -51,20 +51,10 @@ if (!defined('PHPBB_INSTALLED'))
$server_port = 443;
}
$script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
if (!$script_name)
{
$script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
}
// $phpbb_root_path accounts for redirects from e.g. /adm
$script_path = trim(dirname($script_name)) . '/' . $phpbb_root_path . 'install/app.' . $phpEx;
// Replace any number of consecutive backslashes and/or slashes with a single slash
// (could happen on some proxy setups and/or Windows servers)
$script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);
$script_path = phpbb_get_install_redirect($phpbb_root_path, $phpEx);
// Eliminate . and .. from the path
require($phpbb_root_path . 'phpbb/filesystem.' . $phpEx);
require($phpbb_root_path . 'phpbb/filesystem/helper.' . $phpEx);
$script_path = \phpbb\filesystem\helper::clean_path($script_path);
$url = (($secure) ? 'https://' : 'http://') . $server_name;