1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

Merge branch 'develop-ascraeus' into develop

* develop-ascraeus:
  [ticket/13192] Add test for app.php in external subfolder
  [ticket/13192] Use ltrim() instead of preg_replace()
  [ticket/13192] Order test cases consistently
  [ticket/13192] Remove app.php on mod rewrite even if app.php is outside root
  [ticket/13192] Pass correct parameters and rename method to get_valid_page
  [ticket/13192] Use get_valid_user_page in confirm_box() and cleanup globals
  [ticket/13192] Use get_valid_user_page method in build_url function
  [ticket/13192] Add method for generating valid user page links
This commit is contained in:
Tristan Darricau
2015-01-19 17:52:37 +01:00
3 changed files with 63 additions and 23 deletions

View File

@@ -436,4 +436,29 @@ class phpbb_path_helper_test extends phpbb_test_case
{
$this->assertEquals($this->phpbb_root_path . $expected, $this->path_helper->get_web_root_path_from_ajax_referer($referer_url, $board_url));
}
public function data_get_valid_page()
{
return array(
// array( current page , mod_rewrite setting , expected output )
array('index', true, 'index'),
array('index', false, 'index'),
array('foo/index', true, 'foo/index'),
array('foo/index', false, 'foo/index'),
array('app.php/foo', true, 'foo'),
array('app.php/foo', false, 'app.php/foo'),
array('/../app.php/foo', true, '../foo'),
array('/../app.php/foo', false, '../app.php/foo'),
array('/../example/app.php/foo/bar', true, '../example/foo/bar'),
array('/../example/app.php/foo/bar', false, '../example/app.php/foo/bar'),
);
}
/**
* @dataProvider data_get_valid_page
*/
public function test_get_valid_page($page, $mod_rewrite, $expected)
{
$this->assertEquals($this->phpbb_root_path . $expected, $this->path_helper->get_valid_page($page, $mod_rewrite));
}
}