read())) { if (!preg_match('/(\/neocms\-js\/|\/neocms\-images\/)/', $path)) $entries[] = $entry; } $dir->close(); foreach ($entries as $entry) { $fullname = $path . $entry; $pathname = str_replace('../..', '', $path); $exFolders = preg_replace('/,\s*/', '|', $_SESSION['neoCMSExFolders']); $exFolders = str_replace('-', '\-', $exFolders); $exFolders = str_replace('.', '\.', $exFolders); $exFolders = '/' . str_replace('/', '\/', $exFolders) . '/'; if ($entry != '.' && $entry != '..' && is_dir($fullname)) { if (preg_match($pathpatt, $path) && !in_array($pathname, $matches) && is_writable($path)) $matches[] = $pathname; if (!preg_match($exFolders, $fullname) || $_SESSION['neoCMSExFolders'] == '') findfiles($fullname, $pattern, $pathpatt); } elseif (($entry == '.' || $entry == '..') && is_dir($fullname)) { if (preg_match($pathpatt, $path) && !in_array($pathname, $matches) && is_writable($path)) $matches[] = $pathname; } elseif (is_file($fullname) && preg_match($pattern, $entry)) { if (!in_array($pathname, $matches) && is_writable($path)) $matches[] = $pathname; } } } findfiles("../../$pathdefault", $pattern, $pathpatt); if (sizeof($matches) > 0) { foreach ($matches as $match) { $script = ''; echo $script; } } else { $script = ''; echo $script; } $endscript = ''; echo $endscript; } } } ?>