Filter Unsupported Files

This commit is contained in:
seiichiro 2022-01-11 17:52:40 +01:00
parent 23251909fc
commit aef49fb30f

View file

@ -57,6 +57,8 @@ if (isset($_SESSION[$cdir])
$rmdirs[] = '.'; $rmdirs[] = '.';
$rmdirs[] = '..'; $rmdirs[] = '..';
$files = array_diff(scandir($imagedir.$dir, SCANDIR_SORT_DESCENDING), $rmdirs); $files = array_diff(scandir($imagedir.$dir, SCANDIR_SORT_DESCENDING), $rmdirs);
// Filter Unsupported Files
$files = array_values(preg_grep('/.*\.(?!(webm|sh)).*/i', $files));
$_SESSION[$cdir]['f'] = $files; $_SESSION[$cdir]['f'] = $files;
$_SESSION[$cdir]['d'] = $dirs; $_SESSION[$cdir]['d'] = $dirs;
$_SESSION[$cdir]['t'] = time(); $_SESSION[$cdir]['t'] = time();