Also Cache Dir List

This commit is contained in:
seiichiro 2022-01-11 17:15:40 +01:00
parent 823b330b99
commit 84ed2579b3

View file

@ -37,6 +37,7 @@ if (isset($_SESSION[$dir])
&& !isset($_GET['refcache']))
{
$files = $_SESSION[$dir]['f'];
$dirs = $_SESSION[$dir]['d'];
} else {
$r_imagedir = realpath($imagedir.$dir);
if ($r_imagedir === false || strpos(Helpers::end_dir($r_imagedir), $r_basedir.DIRECTORY_SEPARATOR) !== 0) {
@ -53,6 +54,7 @@ if (isset($_SESSION[$dir])
$rmdirs[] = '..';
$files = array_diff(scandir($imagedir.$dir, SCANDIR_SORT_DESCENDING), $rmdirs);
$_SESSION[$dir]['f'] = $files;
$_SESSION[$dir]['d'] = $dirs;
$_SESSION[$dir]['t'] = time();
}