aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorVarun Agrawal <Varun@VarunAgw.com>2014-03-07 03:44:28 +0530
committerVarun Agrawal <Varun@VarunAgw.com>2014-03-07 03:44:28 +0530
commit429c00644025fa5858370e3315ee4e83427ac249 (patch)
tree2ebc6b3859240216a2262235bc5f157551ed2836 /phpBB/includes
parent1cf8554d0efc00b19062a75e54e86c0926f251ff (diff)
downloadforums-429c00644025fa5858370e3315ee4e83427ac249.tar
forums-429c00644025fa5858370e3315ee4e83427ac249.tar.gz
forums-429c00644025fa5858370e3315ee4e83427ac249.tar.bz2
forums-429c00644025fa5858370e3315ee4e83427ac249.tar.xz
forums-429c00644025fa5858370e3315ee4e83427ac249.zip
[ticket/12250] Remove deprecated phpbb_clean_path function
The function phpbb_clean_path() in functions.php is deprecated and is replaced by filesystem class. Therefore, this function is moved to the functions_compatibility file. PHPBB3-12250
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions_compatibility.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php
index 62c2ba6905..024c656267 100644
--- a/phpBB/includes/functions_compatibility.php
+++ b/phpBB/includes/functions_compatibility.php
@@ -83,3 +83,43 @@ function phpbb_check_hash($password, $hash)
$passwords_manager = $phpbb_container->get('passwords.manager');
return $passwords_manager->check($password, $hash);
}
+
+/**
+* Eliminates useless . and .. components from specified path.
+*
+* Deprecated, use filesystem class instead
+*
+* @param string $path Path to clean
+* @return string Cleaned path
+*
+* @deprecated
+*/
+function phpbb_clean_path($path)
+{
+ global $phpbb_path_helper, $phpbb_container;
+
+ if (!$phpbb_path_helper && $phpbb_container)
+ {
+ $phpbb_path_helper = $phpbb_container->get('path_helper');
+ }
+ else if (!$phpbb_path_helper)
+ {
+ // The container is not yet loaded, use a new instance
+ if (!class_exists('\phpbb\path_helper'))
+ {
+ global $phpbb_root_path, $phpEx;
+ require($phpbb_root_path . 'phpbb/path_helper.' . $phpEx);
+ }
+
+ $phpbb_path_helper = new phpbb\path_helper(
+ new phpbb\symfony_request(
+ new phpbb\request\request()
+ ),
+ new phpbb\filesystem(),
+ $phpbb_root_path,
+ $phpEx
+ );
+ }
+
+ return $phpbb_path_helper->clean_path($path);
+}