Catch Undefined Variables in Directory Scan

This commit is contained in:
seiichiro 2022-02-18 13:08:16 +01:00
parent f73f34e775
commit 51df5547cb

View file

@ -74,8 +74,8 @@ if (isset($_SESSION[$cdir])
$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]['d'] = $dirs;
$_SESSION[$cdir]['f'] = isset($files) ? $files : null;
$_SESSION[$cdir]['d'] = isset($dirs) ? $dirs : null;
$_SESSION[$cdir]['t'] = time();
}