mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 21:38:54 +00:00
Merge branch 'prep-release-3.0.13' into develop-olympus
* prep-release-3.0.13: [ticket/13549] Do not exit when ORIG_PATH_INFO just contains SCRIPT_NAME.
This commit is contained in:
commit
6f5524de26
2 changed files with 7 additions and 2 deletions
|
@ -105,7 +105,7 @@ function deregister_globals()
|
||||||
function phpbb_has_trailing_path($phpEx)
|
function phpbb_has_trailing_path($phpEx)
|
||||||
{
|
{
|
||||||
// Check if path_info is being used
|
// Check if path_info is being used
|
||||||
if (!empty($_SERVER['PATH_INFO']) || !empty($_SERVER['ORIG_PATH_INFO']))
|
if (!empty($_SERVER['PATH_INFO']) || (!empty($_SERVER['ORIG_PATH_INFO']) && $_SERVER['SCRIPT_NAME'] != $_SERVER['ORIG_PATH_INFO']))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,19 +36,24 @@ class phpbb_security_trailing_path_test extends phpbb_test_case
|
||||||
array(true, '', '', '/phpBB/index.php/?foo/a'),
|
array(true, '', '', '/phpBB/index.php/?foo/a'),
|
||||||
array(true, '', '', '/projects/php.bb/phpBB/index.php/?a=5'),
|
array(true, '', '', '/projects/php.bb/phpBB/index.php/?a=5'),
|
||||||
array(false, '', '', '/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
|
* @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;
|
global $phpEx;
|
||||||
|
|
||||||
$_SERVER['PATH_INFO'] = $path_info;
|
$_SERVER['PATH_INFO'] = $path_info;
|
||||||
$_SERVER['ORIG_PATH_INFO'] = $orig_path_info;
|
$_SERVER['ORIG_PATH_INFO'] = $orig_path_info;
|
||||||
$_SERVER['REQUEST_URI'] = $request_uri;
|
$_SERVER['REQUEST_URI'] = $request_uri;
|
||||||
|
$_SERVER['SCRIPT_NAME'] = $script_name;
|
||||||
|
|
||||||
$this->assertSame($expected, phpbb_has_trailing_path($phpEx));
|
$this->assertSame($expected, phpbb_has_trailing_path($phpEx));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue