diff options
author | Marc Alexander <admin@m-a-styles.de> | 2013-10-03 10:04:59 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2013-10-03 10:04:59 +0200 |
commit | 7006db7a2dd68ec7f7ca3a24d9afa656056f9d8c (patch) | |
tree | aceb567afda7467738ab6b693dc9595a40ac7f2f /phpBB/includes/functions.php | |
parent | 93531e7fb0df7d9cd2de04ca06aa9eb6a847a1c4 (diff) | |
parent | 49ce2c13b26e358b4ccef440094a8fa4b6b9afd7 (diff) | |
download | forums-7006db7a2dd68ec7f7ca3a24d9afa656056f9d8c.tar forums-7006db7a2dd68ec7f7ca3a24d9afa656056f9d8c.tar.gz forums-7006db7a2dd68ec7f7ca3a24d9afa656056f9d8c.tar.bz2 forums-7006db7a2dd68ec7f7ca3a24d9afa656056f9d8c.tar.xz forums-7006db7a2dd68ec7f7ca3a24d9afa656056f9d8c.zip |
Merge branch 'develop' of https://github.com/phpbb/phpbb3 into feature/passwords
Conflicts:
phpBB/includes/functions.php
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index c49c1d809b..953c0a3b1c 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1025,31 +1025,32 @@ else */ function phpbb_clean_path($path) { - global $phpbb_container; + global $phpbb_path_helper, $phpbb_container; - if ($phpbb_container) + if (!$phpbb_path_helper && $phpbb_container) { - $phpbb_filesystem = $phpbb_container->get('filesystem'); + $phpbb_path_helper = $phpbb_container->get('path_helper'); } - else + else if (!$phpbb_path_helper) { // The container is not yet loaded, use a new instance - if (!class_exists('\phpbb\filesystem')) + if (!class_exists('\phpbb\path_helper')) { global $phpbb_root_path, $phpEx; - require($phpbb_root_path . 'includes/filesystem.' . $phpEx); + require($phpbb_root_path . 'phpbb/path_helper.' . $phpEx); } - $phpbb_filesystem = new phpbb\filesystem( + $phpbb_path_helper = new phpbb\path_helper( new phpbb\symfony_request( new phpbb\request\request() ), + new phpbb\filesystem(), $phpbb_root_path, $phpEx ); } - return $phpbb_filesystem->clean_path($path); + return $phpbb_path_helper->clean_path($path); } // functions used for building option fields @@ -2414,7 +2415,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, $phpbb_filesystem; + global $_SID, $_EXTRA_URL, $phpbb_hook, $phpbb_path_helper; global $phpbb_dispatcher; if ($params === '' || (is_array($params) && empty($params))) @@ -2424,9 +2425,9 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false) } // Update the root path with the correct relative web path - if ($phpbb_filesystem instanceof \phpbb\filesystem) + if ($phpbb_path_helper instanceof \phpbb\path_helper) { - $url = $phpbb_filesystem->update_web_root_path($url); + $url = $phpbb_path_helper->update_web_root_path($url); } $append_sid_overwrite = false; @@ -5245,8 +5246,8 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 // This path is sent with the base template paths in the assign_vars() // call below. We need to correct it in case we are accessing from a // controller because the web paths will be incorrect otherwise. - $phpbb_filesystem = $phpbb_container->get('filesystem'); - $corrected_path = $phpbb_filesystem->get_web_root_path(); + $phpbb_path_helper = $phpbb_container->get('path_helper'); + $corrected_path = $phpbb_path_helper->get_web_root_path(); $web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $corrected_path; // Send a proper content-language to the output |