From: Roland Häder Date: Wed, 24 Apr 2013 03:23:06 +0000 (+0000) Subject: Exclude directories now X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f151c251ccff7d143c8470e4451ce922ee40bd9d;p=mailer.git Exclude directories now --- diff --git a/inc/functions.php b/inc/functions.php index e68db149d1..9060a90193 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1865,7 +1865,7 @@ function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = FALSE, $ad // We found .php file but should not search for them, why? reportBug(__FUNCTION__, __LINE__, 'We should find files with extension=' . $extension . ', but we found a PHP script. (baseFile=' . $baseFile . ')'); } - } elseif (($fileExtension == $extension) || (empty($extension))) { + } elseif ((($fileExtension == $extension) || (empty($extension))) && (isFileReadable($FQFN))) { // Other, generic file found if ($addBaseDir === TRUE) { // With base path diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 32ab18e167..0969cf0bc5 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -199,7 +199,7 @@ function isDirectory ($FQFN) { $baseName = basename($FQFN); // Check it - $GLOBALS[__FUNCTION__][$FQFN] = ((is_dir($FQFN)) && ($baseName != '.') && ($baseName != '..') && ($baseName != '.svn')); + $GLOBALS[__FUNCTION__][$FQFN] = ((is_dir($FQFN)) && (!in_array($baseName, array('.', '..', '.svn')))); } // END - if // Return the result