From f151c251ccff7d143c8470e4451ce922ee40bd9d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 24 Apr 2013 03:23:06 +0000 Subject: [PATCH 1/1] Exclude directories now --- inc/functions.php | 2 +- inc/wrapper-functions.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 -- 2.30.2