CRM-13108 - CRM_Utils_File - Performance fix
authorTim Otten <totten@civicrm.org>
Wed, 24 Jul 2013 17:57:33 +0000 (10:57 -0700)
committerTim Otten <totten@civicrm.org>
Wed, 24 Jul 2013 17:57:33 +0000 (10:57 -0700)
----------------------------------------
* CRM-13108: Warnings when extensions is installed
  http://issues.civicrm.org/jira/browse/CRM-13108

CRM/Utils/File.php

index 5d068bf18d4e6a1a1c2d295a5e56294e8256fd43..68b8438a9587aa20859e96f4e9326f18f64f14d2 100644 (file)
@@ -529,8 +529,9 @@ HTACCESS;
     $result = array();
     while (!empty($todos)) {
       $subdir = array_shift($todos);
-      if (is_array(glob("$subdir/$pattern"))) {
-        foreach (glob("$subdir/$pattern") as $match) {
+      $matches = glob("$subdir/$pattern");
+      if (is_array($matches)) {
+        foreach ($matches as $match) {
           if (!is_dir($match)) {
             $result[] = $match;
           }