aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-04-18 09:53:02 +0200
committerJoas Schilling <nickvergessen@gmx.de>2013-04-18 09:53:02 +0200
commitccd4a725da5269189cdb73a3d7048359a5d2cd4d (patch)
treeb28ab319952a0f487096fb4e2a5f82e791991551 /phpBB/includes
parentffe9f2a93e7bb91378e462b44a786252bddbd0be (diff)
downloadforums-ccd4a725da5269189cdb73a3d7048359a5d2cd4d.tar
forums-ccd4a725da5269189cdb73a3d7048359a5d2cd4d.tar.gz
forums-ccd4a725da5269189cdb73a3d7048359a5d2cd4d.tar.bz2
forums-ccd4a725da5269189cdb73a3d7048359a5d2cd4d.tar.xz
forums-ccd4a725da5269189cdb73a3d7048359a5d2cd4d.zip
[ticket/11362] Add compatibility function phpbb_clean_path() again
The function first depends on the container, but also works without it and without autoload. The reason for this is, it might be used before that stuff is set up, like it has been in our common.php PHPBB3-11362
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 39a8dbc880..998c52b7c6 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1046,6 +1046,38 @@ else
}
}
+/**
+* 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_container;
+
+ if ($phpbb_container)
+ {
+ $phpbb_filesystem = new phpbb_filesystem();
+ }
+ else
+ {
+ // The container is not yet loaded, use a new instance
+ if (!class_exists('phpbb_filesystem'))
+ {
+ global $phpbb_root_path, $phpEx;
+ require($phpbb_root_path . 'includes/filesystem.' . $phpEx);
+ }
+ $phpbb_filesystem = new phpbb_filesystem();
+ }
+
+ return $phpbb_filesystem->clean_path($path);
+}
+
// functions used for building option fields
/**