0) {
foreach ($matches as $match) {
$fname = str_replace('../../', '', $match);
$flink = siteURL() . $fname;
if (preg_match('/\.bmp|\.gif|\.jpeg|\.jpg|\.png/i', $fname)) {
if (!strstr($imghtml, 'neoCMSImgUL')) $imghtml = '
';
if (($_SESSION['neoCMSImagePath'] == null || $_SESSION['neoCMSImagePath'] == '') || strstr($fname, $_SESSION['neoCMSImagePath'])) $imghtml = str_replace('', '' . $fname . '
', $imghtml);
} elseif (preg_match('/\.html|\.htm|\.php|\.phtml|\.cfm|\.shtml|\.asp/i', $fname)) {
if (!strstr($pagehtml, 'neoCMSPagesUL')) $pagehtml = '';
$pagehtml = str_replace('', '' . $fname . '', $pagehtml);
} else {
if (!strstr($filehtml, 'neoCMSFileUL')) $filehtml = '';
if (($_SESSION['neoCMSFilePath'] == null || $_SESSION['neoCMSFilePath'] == '') || strstr($fname, $_SESSION['neoCMSFilePath'])) $filehtml = str_replace('', '' . $fname . '', $filehtml);
}
}
$matches = $imghtml . $pagehtml . $filehtml;
$script = "";
echo $script;
} else {
$script = '';
echo $script;
}
$endscript = "";
echo $endscript;
}
}
}
function findfiles($path, $pattern)
{
$matches = [];
$path = rtrim(str_replace("\\", "/", $path), '/') . '/';
$entries = array();
$dir = dir($path);
$neocmspath = "/\/" . $_SESSION['neoCMSPath'] . "\//";
while (false !== ($entry = $dir->read())) {
if (!preg_match($neocmspath, $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) && is_readable($fullname) && (!preg_match($exFolders, $fullname) || $_SESSION['neoCMSExFolders'] == '')) findfiles($fullname, $pattern);
elseif ($entry != '.' && $entry != '..' && is_file($fullname) && preg_match($pattern, $entry)) {
if (!in_array($pathname, $matches)) {
if (preg_match('/\.html|\.htm|\.php|\.cfm|\.phtml|\.shtml|\.asp/', $fullname)) {
$content = file_get_contents($fullname);
if (checkContent($content)) {
$matches[] = $fullname;
}
} else $matches[] = $fullname;
}
}
}
return $matches;
}
function checkContent($content)
{
global $type;
if (stristr($content, '[^<]+', $content) || (preg_match('/