Fixed: removes the ending slash if the script path is empty resulting in a double slash in the URL

git-svn-id: file:///svn/phpbb/trunk@4412 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Ludovic Arnaud 2003-08-17 17:52:30 +00:00
parent c2a42988c7
commit bf25f0df9a

View file

@ -864,7 +864,9 @@ function generate_board_url()
{
global $config;
return (($config['cookie_secure']) ? 'https://' : 'http://') . preg_replace('#^/?(.*?)/?$#', '\1', trim($config['server_name'])) . (($config['server_port'] <> 80) ? ':' . trim($config['server_port']) . '/' : '/') . preg_replace('#^/?(.*?)/?$#', '\1', trim($config['script_path']));
$path = preg_replace('#^/?(.*?)/?$#', '\1', trim($config['script_path']));
return (($config['cookie_secure']) ? 'https://' : 'http://') . preg_replace('#^/?(.*?)/?$#', '\1', trim($config['server_name'])) . (($config['server_port'] <> 80) ? ':' . trim($config['server_port']) : '') . (($path) ? '/' . $path : '');
}
// Redirects the user to another page then exits the script nicely