aboutsummaryrefslogtreecommitdiffstats
path: root/tests/security/redirect_test.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-12-28 00:14:12 +0100
committerMarc Alexander <admin@m-a-styles.de>2013-12-28 00:14:12 +0100
commit4c1569dd8ab6d85aecd0bd30913512542d1f123d (patch)
tree2d417083f58a5813e8a284885251663cfa6d8c7c /tests/security/redirect_test.php
parentce2c5213d7aad2c24ee83147b167236ce754c671 (diff)
downloadforums-4c1569dd8ab6d85aecd0bd30913512542d1f123d.tar
forums-4c1569dd8ab6d85aecd0bd30913512542d1f123d.tar.gz
forums-4c1569dd8ab6d85aecd0bd30913512542d1f123d.tar.bz2
forums-4c1569dd8ab6d85aecd0bd30913512542d1f123d.tar.xz
forums-4c1569dd8ab6d85aecd0bd30913512542d1f123d.zip
[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
Diffstat (limited to 'tests/security/redirect_test.php')
-rw-r--r--tests/security/redirect_test.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/security/redirect_test.php b/tests/security/redirect_test.php
index ce2d865c44..77dc955c26 100644
--- a/tests/security/redirect_test.php
+++ b/tests/security/redirect_test.php
@@ -116,9 +116,12 @@ class phpbb_security_redirect_test extends phpbb_security_test_base
$phpbb_path_helper = $this->path_helper;
$temp_phpbb_root_path = $phpbb_root_path;
- // We need to hack phpbb_root_path here, so it matches the actual fileinfo of the testing script.
+ $temp_page_dir = $user->page['page_dir'];
+ // We need to hack phpbb_root_path and the user's page_dir here
+ // so it matches the actual fileinfo of the testing script.
// Otherwise the paths are returned incorrectly.
$phpbb_root_path = '';
+ $user->page['page_dir'] = '';
if ($expected_error !== false)
{
@@ -133,5 +136,6 @@ class phpbb_security_redirect_test extends phpbb_security_test_base
$this->assertEquals($expected_result, $result);
}
$phpbb_root_path = $temp_phpbb_root_path;
+ $user->page['page_dir'] = $temp_page_dir;
}
}