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 {
// 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
- 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