aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_compatibility.php
diff options
context:
space:
mode:
authorDhruv <dhruv.goel92@gmail.com>2014-03-08 18:14:05 +0530
committerDhruv <dhruv.goel92@gmail.com>2014-03-08 18:14:05 +0530
commit9100f4ebbfba9a4eb7a91e545bf85a3982ffc0dd (patch)
tree2187c3f1697e25026d0041f43fab4fa0ad4ea7d6 /phpBB/includes/functions_compatibility.php
parent19d0c2abd54e57d4490d881e5031d6fd3a511679 (diff)
parent429c00644025fa5858370e3315ee4e83427ac249 (diff)
downloadforums-9100f4ebbfba9a4eb7a91e545bf85a3982ffc0dd.tar
forums-9100f4ebbfba9a4eb7a91e545bf85a3982ffc0dd.tar.gz
forums-9100f4ebbfba9a4eb7a91e545bf85a3982ffc0dd.tar.bz2
forums-9100f4ebbfba9a4eb7a91e545bf85a3982ffc0dd.tar.xz
forums-9100f4ebbfba9a4eb7a91e545bf85a3982ffc0dd.zip
Merge remote-tracking branch 'VarunAgw/ticket/12250' into develop
# By Varun Agrawal # Via Varun Agrawal * VarunAgw/ticket/12250: [ticket/12250] Remove deprecated phpbb_clean_path function [ticket/12250] Remove deprecated phpbb_clean_path function
Diffstat (limited to 'phpBB/includes/functions_compatibility.php')
-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);
+}