mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 14:48:53 +00:00
[ticket/12620] Fix download/file.php and app.php outside of the root_path
PHPBB3-12620
This commit is contained in:
parent
014eed385b
commit
998b4baa71
2 changed files with 9 additions and 4 deletions
|
@ -42,6 +42,11 @@ if (isset($_GET['avatar']))
|
||||||
$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
|
$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
|
||||||
extract($phpbb_config_php_file->get_all());
|
extract($phpbb_config_php_file->get_all());
|
||||||
|
|
||||||
|
if (!defined('PHPBB_ENVIRONMENT'))
|
||||||
|
{
|
||||||
|
@define('PHPBB_ENVIRONMENT', 'production');
|
||||||
|
}
|
||||||
|
|
||||||
if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
|
if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
|
||||||
{
|
{
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -57,9 +57,9 @@ function phpbb_get_url_matcher(\phpbb\extension\manager $manager, RequestContext
|
||||||
*/
|
*/
|
||||||
function phpbb_create_dumped_url_matcher(\phpbb\extension\manager $manager, $root_path, $php_ext)
|
function phpbb_create_dumped_url_matcher(\phpbb\extension\manager $manager, $root_path, $php_ext)
|
||||||
{
|
{
|
||||||
$provider = new \phpbb\controller\provider();
|
$provider = new \phpbb\controller\provider($root_path);
|
||||||
$provider->find_routing_files($manager->all_enabled());
|
$provider->find_routing_files($manager->all_enabled());
|
||||||
$routes = $provider->find($root_path)->get_routes();
|
$routes = $provider->find()->get_routes();
|
||||||
$dumper = new PhpMatcherDumper($routes);
|
$dumper = new PhpMatcherDumper($routes);
|
||||||
$cached_url_matcher_dump = $dumper->dump(array(
|
$cached_url_matcher_dump = $dumper->dump(array(
|
||||||
'class' => 'phpbb_url_matcher',
|
'class' => 'phpbb_url_matcher',
|
||||||
|
@ -77,9 +77,9 @@ function phpbb_create_dumped_url_matcher(\phpbb\extension\manager $manager, $roo
|
||||||
*/
|
*/
|
||||||
function phpbb_create_url_matcher(\phpbb\extension\manager $manager, RequestContext $context, $root_path)
|
function phpbb_create_url_matcher(\phpbb\extension\manager $manager, RequestContext $context, $root_path)
|
||||||
{
|
{
|
||||||
$provider = new \phpbb\controller\provider();
|
$provider = new \phpbb\controller\provider($root_path);
|
||||||
$provider->find_routing_files($manager->all_enabled());
|
$provider->find_routing_files($manager->all_enabled());
|
||||||
$routes = $provider->find($root_path)->get_routes();
|
$routes = $provider->find()->get_routes();
|
||||||
return new UrlMatcher($routes, $context);
|
return new UrlMatcher($routes, $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue