phpBB

Code Changes

File: common.php

  Unmodified   Added   Modified   Removed
Line 26Line 26
if (!defined('PHPBB_INSTALLED'))
{
// Redirect the user to the installer

if (!defined('PHPBB_INSTALLED'))
{
// Redirect the user to the installer

 
	require($phpbb_root_path . 'includes/functions.' . $phpEx);


	// We have to generate a full HTTP/1.1 header here since we can't guarantee to have any of the information
// available as used by the redirect function
$server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));

	// We have to generate a full HTTP/1.1 header here since we can't guarantee to have any of the information
// available as used by the redirect function
$server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));

Line 38Line 40
		$script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
}


		$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/index.' . $phpEx;

	// Replace any number of consecutive backslashes and/or slashes with a single slash
// (could happen on some proxy setups and/or Windows servers)

	// 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 = trim(dirname($script_name)) . '/install/index.' . $phpEx;

 
	$script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);

	$script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);

 
	// Eliminate . and .. from the path
$script_path = phpbb_clean_path($script_path);


$url = (($secure) ? 'https://' : 'http://') . $server_name;



$url = (($secure) ? 'https://' : 'http://') . $server_name;