From bf25f0df9ad172aa8353656441ace86cddecbb9d Mon Sep 17 00:00:00 2001 From: Ludovic Arnaud Date: Sun, 17 Aug 2003 17:52:30 +0000 Subject: [PATCH] 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 --- phpBB/includes/functions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 42c7fb9fd0..3f9709ba42 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -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