1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-19 15:17:16 +01:00

[ticket/11832] Use $phpbb_filesystem instead of the container in append_sid

PHPBB3-11832
This commit is contained in:
Nathan Guse 2013-09-10 10:13:26 -05:00
parent d5f93f5ce4
commit 3684d8e971
2 changed files with 9 additions and 5 deletions

View File

@ -2409,7 +2409,7 @@ function phpbb_on_page($template, $user, $base_url, $num_items, $per_page, $star
*/
function append_sid($url, $params = false, $is_amp = true, $session_id = false)
{
global $_SID, $_EXTRA_URL, $phpbb_hook;
global $_SID, $_EXTRA_URL, $phpbb_hook, $phpbb_filesystem;
global $phpbb_dispatcher;
global $symfony_request, $phpbb_root_path, $phpbb_container;
@ -2420,8 +2420,10 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
}
// Update the root path with the correct relative web path
$phpbb_filesystem = $phpbb_container->get('filesystem');
$url = $phpbb_filesystem->update_web_root_path($url, $symfony_request);
if ($phpbb_filesystem instanceof phpbb_filesystem)
{
$url = $phpbb_filesystem->update_web_root_path($url, $symfony_request);
}
$append_sid_overwrite = false;
@ -5719,6 +5721,6 @@ function phpbb_create_symfony_request(phpbb_request $request)
array_walk_recursive($get_parameters, $sanitizer);
array_walk_recursive($post_parameters, $sanitizer);
$symfony_request = new Request($get_parameters, $post_parameters, array(), $cookie_parameters, $files_parameters, $server_parameters);
$symfony_request = new Symfony\Component\HttpFoundation\Request($get_parameters, $post_parameters, array(), $cookie_parameters, $files_parameters, $server_parameters);
return $symfony_request;
}

View File

@ -18,7 +18,9 @@ class phpbb_filesystem_web_root_path_test extends phpbb_test_case
$this->set_phpbb_root_path();
$this->filesystem = new phpbb_filesystem($this->phpbb_root_path);
global $phpbb_filesystem;
$phpbb_filesystem = $this->filesystem = new phpbb_filesystem($this->phpbb_root_path);
}
/**