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