use built-in is_dir() function

This commit is contained in:
Piotr KUCHARSKI 2014-11-25 12:32:23 +01:00
parent f5ede76883
commit 1989ea5ce3

View file

@ -66,15 +66,6 @@ if (!function_exists('exif_read_data') && $display_exif == 1) {
//----------------------- //-----------------------
// FUNCTIONS // FUNCTIONS
//----------------------- //-----------------------
function is_directory($filepath) {
// $filepath must be the entire system path to the file
if (!@opendir($filepath)) return FALSE;
else {
return TRUE;
closedir($filepath);
}
}
function padstring($name, $length) { function padstring($name, $length) {
global $label_max_length; global $label_max_length;
if (!isset($length)) $length = $label_max_length; if (!isset($length)) $length = $label_max_length;
@ -151,12 +142,12 @@ $currentdir = GALLERY_ROOT . $thumbdir;
//----------------------- //-----------------------
$files = array(); $files = array();
$dirs = array(); $dirs = array();
if (is_directory($currentdir) && $handle = opendir($currentdir)) if (is_dir($currentdir) && $handle = opendir($currentdir))
{ {
while (false !== ($file = readdir($handle)) && !in_array($file, $SkipObjects)) while (false !== ($file = readdir($handle)) && !in_array($file, $SkipObjects))
{ {
// 1. LOAD FOLDERS // 1. LOAD FOLDERS
if (is_directory($currentdir . "/" . $file)) if (is_dir($currentdir . "/" . $file))
{ {
if ($file != "." && $file != ".." ) if ($file != "." && $file != ".." )
{ {