From 4c1569dd8ab6d85aecd0bd30913512542d1f123d Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 28 Dec 2013 00:14:12 +0100 Subject: [ticket/11997] Add user's page dir to redirect path and fix unit tests for it The user's page directory needs to be added to the redirect URL for proper redirects outside of the forum root. Fix the unit tests accordingly. PHPBB3-11997 --- phpBB/includes/functions.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/functions.php') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index bd6a45685d..cc8478ace1 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2708,7 +2708,14 @@ function redirect($url, $return = false, $disable_cd_check = false) } } - $url = generate_board_url() . '/' . $phpbb_path_helper->remove_web_root_path($url); + $url = $phpbb_path_helper->remove_web_root_path($url); + + if ($user->page['page_dir']) + { + $url = $user->page['page_dir'] . '/' . $url; + } + + $url = generate_board_url() . '/' . $url; } // Clean URL and check if we go outside the forum directory -- cgit v1.2.1