phpBB

Code Changes

File: common.php

  Unmodified   Added   Modified   Removed
Line 12Line 12
*/

/**

*/

/**

* Minimum Requirement: PHP 7.1.3

* Minimum Requirement: PHP 7.2.0

*/

if (!defined('IN_PHPBB'))

*/

if (!defined('IN_PHPBB'))

Line 51Line 51
		$server_port = 443;
}


		$server_port = 443;
}


	$script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
if (!$script_name)
{
$script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
}

// $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


// Eliminate . and .. from the path

	require($phpbb_root_path . 'phpbb/filesystem.' . $phpEx);

	require($phpbb_root_path . 'phpbb/filesystem/filesystem.' . $phpEx);

	$phpbb_filesystem = new phpbb\filesystem\filesystem();
$script_path = $phpbb_filesystem->clean_path($script_path);


	$phpbb_filesystem = new phpbb\filesystem\filesystem();
$script_path = $phpbb_filesystem->clean_path($script_path);


Line 114Line 104
try
{
$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx);

try
{
$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx);

 

// Check that cache directory is writable before trying to build container
$cache_dir = $phpbb_container_builder->get_cache_dir();
if (file_exists($cache_dir) && !is_writable($phpbb_container_builder->get_cache_dir()))
{
die('Unable to write to the cache directory path "' . $cache_dir . '". Ensure that the web server user can write to the cache folder.');
}


	$phpbb_container = $phpbb_container_builder->with_config($phpbb_config_php_file)->get_container();
}
catch (InvalidArgumentException $e)

	$phpbb_container = $phpbb_container_builder->with_config($phpbb_config_php_file)->get_container();
}
catch (InvalidArgumentException $e)