From 971c31241c59b933d563f712a893b0c54ad33557 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 24 Apr 2013 02:50:32 +0000 Subject: [PATCH] Fixes --- inc/functions.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index c227a23925..e68db149d1 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1854,7 +1854,7 @@ function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = FALSE, $ad if ($addBaseDir === TRUE) { // With base path array_push($foundMatches, $fileName); - } elseif ($withPrefixSuffix === FALSE) { + } elseif (($withPrefixSuffix === FALSE) && (!empty($extension))) { // No prefix/suffix array_push($foundMatches, substr($baseFile, strlen($prefix), -strlen($suffix . $extension))); } else { @@ -1867,7 +1867,16 @@ function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = FALSE, $ad } } elseif (($fileExtension == $extension) || (empty($extension))) { // Other, generic file found - array_push($foundMatches, $fileName); + if ($addBaseDir === TRUE) { + // With base path + array_push($foundMatches, $fileName); + } elseif (($withPrefixSuffix === FALSE) && (!empty($extension))) { + // No prefix/suffix + array_push($foundMatches, substr($baseFile, strlen($prefix), -strlen($suffix . $extension))); + } else { + // No base path + array_push($foundMatches, $baseFile); + } } } // END - while -- 2.30.2