* @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] !== '..') { array_pop($filtered); } else { $filtered[] = $part; } } $path = implode('/', $filtered); return $path; } } > Mageia Installer HelpMarja Van Waes [marja]
aboutsummaryrefslogtreecommitdiffstats
path: root/pt_br/setupSCSI.html
diff options
context:
space:
mode:
authorMarja van Waes <marja@mageia.org>2014-10-12 00:19:42 +0200
committerMarja van Waes <marja@mageia.org>2014-10-12 00:19:42 +0200
commit80e382a8c8e25e80fbf2ae80fe1b854df2bea0eb (patch)
tree6c26988969d408932432543c0e8fa0ed5f3c2833 /pt_br/setupSCSI.html
parent4f4a9d6df3e82f346607af7d5de4e8ff9f0f1efa (diff)
downloaddrakx-installer-help-80e382a8c8e25e80fbf2ae80fe1b854df2bea0eb.tar
drakx-installer-help-80e382a8c8e25e80fbf2ae80fe1b854df2bea0eb.tar.gz
drakx-installer-help-80e382a8c8e25e80fbf2ae80fe1b854df2bea0eb.tar.bz2
drakx-installer-help-80e382a8c8e25e80fbf2ae80fe1b854df2bea0eb.tar.xz
drakx-installer-help-80e382a8c8e25e80fbf2ae80fe1b854df2bea0eb.zip