Fixed DirectoryUtil
authorMatthias Schmidt <gravatronics@live.com>
Mon, 25 Jul 2011 18:15:22 +0000 (20:15 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 25 Jul 2011 18:15:22 +0000 (20:15 +0200)
Provided by TimWolla.

wcfsetup/install/files/lib/util/DirectoryUtil.class.php

index a66d51f531c6ed9d01fdfb05025b9ea648120153..1d184936ad39faab7da2e78872148fbccb8dea6e 100644 (file)
@@ -152,7 +152,7 @@ class DirectoryUtil {
                // 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]);
                        }
                }
 
@@ -188,7 +188,7 @@ class DirectoryUtil {
                // 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]);
                        }
                }