From 1989ea5ce3138b8d56004b22d073fd84684885ac Mon Sep 17 00:00:00 2001 From: Piotr KUCHARSKI Date: Tue, 25 Nov 2014 12:32:23 +0100 Subject: [PATCH] use built-in is_dir() function --- index.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/index.php b/index.php index a4d0e58..24ef082 100644 --- a/index.php +++ b/index.php @@ -66,15 +66,6 @@ if (!function_exists('exif_read_data') && $display_exif == 1) { //----------------------- // 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) { global $label_max_length; if (!isset($length)) $length = $label_max_length; @@ -151,12 +142,12 @@ $currentdir = GALLERY_ROOT . $thumbdir; //----------------------- $files = 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)) { // 1. LOAD FOLDERS - if (is_directory($currentdir . "/" . $file)) + if (is_dir($currentdir . "/" . $file)) { if ($file != "." && $file != ".." ) {