mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Merge remote-tracking branch 'marc/ticket/12004' into develop-ascraeus
* marc/ticket/12004: [ticket/12004] Support empty routes to app.php/ in path_helper
This commit is contained in:
commit
b487da7c05
2 changed files with 17 additions and 0 deletions
|
@ -148,6 +148,16 @@ class path_helper
|
|||
// Script name URI (e.g. phpBB/app.php)
|
||||
$script_name = $this->symfony_request->getScriptName();
|
||||
|
||||
/*
|
||||
* If the path info is empty but we're using app.php, then we
|
||||
* might be using an empty route like app.php/ which is
|
||||
* supported by symfony's routing
|
||||
*/
|
||||
if ($path_info === '/' && preg_match('/app\.' . $this->php_ext . '\/$/', $request_uri))
|
||||
{
|
||||
return $this->web_root_path = $this->phpbb_root_path . '../';
|
||||
}
|
||||
|
||||
/*
|
||||
* If the path info is empty (single /), then we're not using
|
||||
* a route like app.php/foo/bar
|
||||
|
|
|
@ -116,6 +116,13 @@ class phpbb_path_helper_web_root_path_test extends phpbb_test_case
|
|||
'/phpbb3-fork/phpBB/foo/template',
|
||||
'/phpbb3-fork/phpBB/app.php',
|
||||
),
|
||||
array(
|
||||
$this->phpbb_root_path . 'test.php',
|
||||
$this->phpbb_root_path . '../test.php',
|
||||
'/',
|
||||
'/phpbb3-fork/phpBB/app.php/',
|
||||
'/phpbb3-fork/phpBB/app.php',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue