mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 14:28:56 +00:00
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8348 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
9451f7feab
commit
c7821700dd
8 changed files with 103 additions and 84 deletions
|
@ -131,7 +131,7 @@ if (!defined('PHPBB_INSTALLED'))
|
|||
// Redirect the user to the installer
|
||||
// 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['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
|
||||
$server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
|
||||
$server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT');
|
||||
$secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0;
|
||||
|
||||
|
@ -149,9 +149,13 @@ if (!defined('PHPBB_INSTALLED'))
|
|||
$url = (($secure) ? 'https://' : 'http://') . $server_name;
|
||||
|
||||
if ($server_port && (($secure && $server_port <> 443) || (!$secure && $server_port <> 80)))
|
||||
{
|
||||
// HTTP HOST can carry a port number...
|
||||
if (strpos($server_name, ':') === false)
|
||||
{
|
||||
$url .= ':' . $server_port;
|
||||
}
|
||||
}
|
||||
|
||||
$url .= $script_path;
|
||||
header('Location: ' . $url);
|
||||
|
|
|
@ -105,6 +105,7 @@
|
|||
<li>[Fix] Possible login problems with IE7 if browser check is activated (Bug #20135)</li>
|
||||
<li>[Fix] Fix possible database transaction errors if code returns on error and rollback happened (Bug #17025)</li>
|
||||
<li>[Change] Allow numbers in permission names for modifications, as well as uppercase letters for the request_ part (Bug #20125)</li>
|
||||
<li>[Fix] Use HTTP_HOST in favor of SERVER_NAME for determining server url for redirection and installation (Bug #19955)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc8"></a><h3>1.i. Changes since 3.0.RC8</h3>
|
||||
|
|
|
@ -558,7 +558,7 @@ function download_allowed()
|
|||
}
|
||||
|
||||
// Check for own server...
|
||||
$server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
|
||||
$server_name = $user->host;
|
||||
|
||||
// Forcing server vars is the only way to specify/override the protocol
|
||||
if ($config['force_server_vars'] || !$server_name)
|
||||
|
|
|
@ -1719,7 +1719,7 @@ function generate_board_url($without_script_path = false)
|
|||
{
|
||||
global $config, $user;
|
||||
|
||||
$server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
|
||||
$server_name = $user->host;
|
||||
$server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT');
|
||||
|
||||
// Forcing server vars is the only way to specify/override the protocol
|
||||
|
@ -1742,9 +1742,13 @@ function generate_board_url($without_script_path = false)
|
|||
}
|
||||
|
||||
if ($server_port && (($config['cookie_secure'] && $server_port <> 443) || (!$config['cookie_secure'] && $server_port <> 80)))
|
||||
{
|
||||
// HTTP HOST can carry a port number...
|
||||
if (strpos($server_name, ':') === false)
|
||||
{
|
||||
$url .= ':' . $server_port;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$without_script_path)
|
||||
{
|
||||
|
|
|
@ -983,7 +983,7 @@ class bbcode_firstpass extends bbcode
|
|||
// Is the user trying to link to a php file in this domain and script path?
|
||||
if (strpos($url, ".{$phpEx}") !== false && strpos($url, $check_path) !== false)
|
||||
{
|
||||
$server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
|
||||
$server_name = $user->host;
|
||||
|
||||
// Forcing server vars is the only way to specify/override the protocol
|
||||
if ($config['force_server_vars'] || !$server_name)
|
||||
|
|
|
@ -158,7 +158,7 @@ class session
|
|||
$this->update_session_page = $update_session_page;
|
||||
$this->browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : '';
|
||||
$this->forwarded_for = (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? (string) $_SERVER['HTTP_X_FORWARDED_FOR'] : '';
|
||||
$this->host = (!empty($_SERVER['HTTP_HOST'])) ? (string) $_SERVER['HTTP_HOST'] : 'localhost';
|
||||
$this->host = (!empty($_SERVER['HTTP_HOST'])) ? (string) strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
|
||||
$this->page = $this->extract_current_page($phpbb_root_path);
|
||||
|
||||
// if the forwarded for header shall be checked we have to validate its contents
|
||||
|
|
|
@ -493,7 +493,8 @@ class module
|
|||
*/
|
||||
function redirect($page)
|
||||
{
|
||||
$server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
|
||||
// HTTP_HOST is having the correct browser url in most cases...
|
||||
$server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
|
||||
$server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT');
|
||||
$secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0;
|
||||
|
||||
|
@ -510,9 +511,13 @@ class module
|
|||
$url = (($secure) ? 'https://' : 'http://') . $server_name;
|
||||
|
||||
if ($server_port && (($secure && $server_port <> 443) || (!$secure && $server_port <> 80)))
|
||||
{
|
||||
// HTTP HOST can carry a port number...
|
||||
if (strpos($server_name, ':') === false)
|
||||
{
|
||||
$url .= ':' . $server_port;
|
||||
}
|
||||
}
|
||||
|
||||
$url .= $script_path . '/' . $page;
|
||||
header('Location: ' . $url);
|
||||
|
|
|
@ -1018,8 +1018,11 @@ class install_install extends module
|
|||
$s_hidden_fields = ($data['img_imagick']) ? '<input type="hidden" name="img_imagick" value="' . addslashes($data['img_imagick']) . '" />' : '';
|
||||
$s_hidden_fields .= '<input type="hidden" name="language" value="' . $data['language'] . '" />';
|
||||
|
||||
// HTTP_HOST is having the correct browser url in most cases...
|
||||
$server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
|
||||
|
||||
$data['email_enable'] = ($data['email_enable'] !== '') ? $data['email_enable'] : true;
|
||||
$data['server_name'] = ($data['server_name'] !== '') ? $data['server_name'] : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
|
||||
$data['server_name'] = ($data['server_name'] !== '') ? $data['server_name'] : $server_name;
|
||||
$data['server_port'] = ($data['server_port'] !== '') ? $data['server_port'] : ((!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT'));
|
||||
$data['server_protocol'] = ($data['server_protocol'] !== '') ? $data['server_protocol'] : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://');
|
||||
$data['cookie_secure'] = ($data['cookie_secure'] !== '') ? $data['cookie_secure'] : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? true : false);
|
||||
|
@ -1109,7 +1112,9 @@ class install_install extends module
|
|||
$this->p_master->redirect("index.$phpEx?mode=install");
|
||||
}
|
||||
|
||||
$cookie_domain = ($data['server_name'] != '') ? $data['server_name'] : (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
|
||||
// HTTP_HOST is having the correct browser url in most cases...
|
||||
$server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
|
||||
$cookie_domain = ($data['server_name'] != '') ? $data['server_name'] : $server_name;
|
||||
|
||||
// Try to come up with the best solution for cookie domain...
|
||||
if (strpos($cookie_domain, 'www.') === 0)
|
||||
|
|
Loading…
Add table
Reference in a new issue