diff options
author | Marc Alexander <admin@m-a-styles.de> | 2015-01-27 22:12:32 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2015-01-28 22:07:16 +0100 |
commit | 74950559074d738733ac1258b07912f9ca14203a (patch) | |
tree | 194ebc8fbe9501b68569ae4fc561e700ada2cddd /tests/security/trailing_path_test.php | |
parent | 5ce89ae82f7be38ef539872dc1fd360fb45c906a (diff) | |
download | forums-74950559074d738733ac1258b07912f9ca14203a.tar forums-74950559074d738733ac1258b07912f9ca14203a.tar.gz forums-74950559074d738733ac1258b07912f9ca14203a.tar.bz2 forums-74950559074d738733ac1258b07912f9ca14203a.tar.xz forums-74950559074d738733ac1258b07912f9ca14203a.zip |
[ticket/13549] Do not exit when ORIG_PATH_INFO just contains SCRIPT_NAME.
The ORIG_PATH_INFO on IIS also contains the script name. Only use that
for killing the script after removing the script name from ORIG_PATH_INFO.
PHPBB3-13549
Diffstat (limited to 'tests/security/trailing_path_test.php')
-rw-r--r-- | tests/security/trailing_path_test.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/security/trailing_path_test.php b/tests/security/trailing_path_test.php index 72ec6b8816..9d586e74ef 100644 --- a/tests/security/trailing_path_test.php +++ b/tests/security/trailing_path_test.php @@ -36,19 +36,24 @@ class phpbb_security_trailing_path_test extends phpbb_test_case array(true, '', '', '/phpBB/index.php/?foo/a'), array(true, '', '', '/projects/php.bb/phpBB/index.php/?a=5'), array(false, '', '', '/projects/php.bb/phpBB/index.php?/a=5'), + array(false, '', '/phpBB/index.php', '/phpBB/index.php', '/phpBB/index.php'), + array(true, '', '/phpBB/index.php', '/phpBB/index.php'), + array(true, '', '/phpBB/index.php/', '/phpBB/index.php/', '/phpBB/index.php'), + array(true, '', '/phpBB/index.php/', '/phpBB/index.php/'), ); } /** * @dataProvider data_has_trailing_path */ - public function test_has_trailing_path($expected, $path_info, $orig_path_info, $request_uri) + public function test_has_trailing_path($expected, $path_info, $orig_path_info, $request_uri, $script_name = '') { global $phpEx; $_SERVER['PATH_INFO'] = $path_info; $_SERVER['ORIG_PATH_INFO'] = $orig_path_info; $_SERVER['REQUEST_URI'] = $request_uri; + $_SERVER['SCRIPT_NAME'] = $script_name; $this->assertSame($expected, phpbb_has_trailing_path($phpEx)); } |