* @license GNU General Public License, version 2 (GPL-2.0) * * For full copyright and license information, please see * the docs/CREDITS.txt file. * */ namespace phpbb; /** * A class with various functions that are related to paths, files and the filesystem */ class filesystem { /** * Eliminates useless . and .. components from specified path. * * @param string $path Path to clean * @return string Cleaned path */ public function clean_path($path) { $exploded = explode('/', $path); $filtered = array(); foreach ($exploded as $part) { if ($part === '.' && !empty($filtered)) { continue; } if ($part === '..' && !empty($filtered) && $filtered[sizeof($filtered) - 1] !== '.' && $filtered[sizeof($filtered) - 1] !== '..') { array_pop($filtered); } else { $filtered[] = $part; } } $path = implode('/', $filtered); return $path; } } > The forums.mageia.org WebsiteMaat [maat]
aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/migration/tool/module.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2016-11-12 17:08:28 +0100
committerMarc Alexander <admin@m-a-styles.de>2016-11-12 17:08:28 +0100
commit221cd3eb68276bf2e4a0960369af2b89dd709079 (patch)
treed325896d3f6eb592d597c8f6d0cdeeeffa7100b9 /phpBB/phpbb/db/migration/tool/module.php
parentbc4c82bae5f93a4e482caf29a931882d07fb90fd (diff)
parent552691efbfa7063efdf2a29ac0577ea7f644d029 (diff)
downloadforums-221cd3eb68276bf2e4a0960369af2b89dd709079.tar
forums-221cd3eb68276bf2e4a0960369af2b89dd709079.tar.gz
forums-221cd3eb68276bf2e4a0960369af2b89dd709079.tar.bz2
forums-221cd3eb68276bf2e4a0960369af2b89dd709079.tar.xz
forums-221cd3eb68276bf2e4a0960369af2b89dd709079.zip
Merge pull request #4495 from senky/ticket/14847
[ticket/14847] Add core.acp_attachments_config_edit_add
Diffstat (limited to 'phpBB/phpbb/db/migration/tool/module.php')
0 files changed, 0 insertions, 0 deletions