// sort out non matching files
if (!empty($pattern)) {
foreach ($files as $filename => $value) {
- if (preg_match($pattern, $filename) != $negativeMatch) unset($files[$filename]);
+ if (((bool) preg_match($pattern, $filename)) == $negativeMatch) unset($objects[$filename]);
}
}
// sort out non matching files
if (!empty($pattern)) {
foreach ($objects as $filename => $value) {
- if (preg_match($pattern, $filename) != $negativeMatch) unset($objects[$filename]);
+ if (((bool) preg_match($pattern, $filename)) == $negativeMatch) unset($objects[$filename]);
}
}