Call fs_is_directorycomponent() and fs_is_hidden_file() instead of checking manually

This commit is contained in:
azett 2022-06-24 21:50:57 +02:00
parent ed8f9e1293
commit 104096f4f4

View File

@ -35,11 +35,7 @@ function gallery_fetch_galleries() {
$dir = opendir(ABS_PATH . IMAGES_DIR); $dir = opendir(ABS_PATH . IMAGES_DIR);
while (false !== ($file = readdir($dir))) { while (false !== ($file = readdir($dir))) {
$fullpath = ABS_PATH . IMAGES_DIR . $file; $fullpath = ABS_PATH . IMAGES_DIR . $file;
if (!in_array($file, array( if (!fs_is_directorycomponent($file) && !fs_is_hidden_file($file) && is_dir($fullpath)) {
".",
"..",
".thumbs"
)) && is_dir($fullpath)) {
$galleries [] = $file; $galleries [] = $file;
} }
} }