mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 06:38:52 +00:00
Fix redirect extra slash when no script_path or / specified
git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3319 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
c7a2433c3c
commit
8115a40d0c
1 changed files with 6 additions and 5 deletions
|
@ -692,7 +692,7 @@ function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '',
|
||||||
// dougk_ff7 <October 5, 2002>
|
// dougk_ff7 <October 5, 2002>
|
||||||
function phpbb_realpath($path)
|
function phpbb_realpath($path)
|
||||||
{
|
{
|
||||||
return (!@function_exists('realpath') || !@realpath($phpbb_root_path . 'includes/functions.'.$phpEx)) ? $path : realpath($path);
|
return (!@function_exists('realpath') || !@realpath($phpbb_root_path . 'includes/functions.'.$phpEx)) ? $path : @realpath($path);
|
||||||
}
|
}
|
||||||
|
|
||||||
function redirect($url)
|
function redirect($url)
|
||||||
|
@ -705,10 +705,11 @@ function redirect($url)
|
||||||
}
|
}
|
||||||
|
|
||||||
$server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';
|
$server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';
|
||||||
$server_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['server_name']));
|
$server_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name']));
|
||||||
$server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) . '/' : '/';
|
$server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) : '';
|
||||||
$script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path']));
|
$script_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path']));
|
||||||
$url = preg_replace('/^\/?(.*?)\/?$/', '/\1', trim($url));
|
$script_name = ($script_name == '') ? $script_name : '/' . $script_name;
|
||||||
|
$url = preg_replace('#^\/?(.*?)\/?$#', '/\1', trim($url));
|
||||||
|
|
||||||
// Redirect via an HTML form for PITA webservers
|
// Redirect via an HTML form for PITA webservers
|
||||||
if (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')))
|
if (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')))
|
||||||
|
|
Loading…
Add table
Reference in a new issue