Call fs_is_directorycomponent() and fs_is_hidden_file() instead of checking manually
This commit is contained in:
parent
ed8f9e1293
commit
104096f4f4
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user