
$dir = (isset($_GET['d']))?$_GET['d']:$_POST['d'];
if ($dir && $config['enable_folder_maxdepth']){
$dir = split("/",$dir);
foreach ($dir as $k => $v) {
if (($v == "..") || ($v == ".") || ($v == "")) unset($dir[$k]);
}
$path = $config['storage_path'];
foreach ($dir as $k => $v) {
if (!file_exists($path."/$v"))
unset($dir[$k]);
else
$path .= "/$v";
}
$config['storage_path'] .= "/".join("/",$dir);
