From 002f17162e596746059b27085c0e2aca351dbb5a Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 24 Jul 2013 10:41:23 -0700 Subject: [PATCH] CRM-13108 - Fix warning in CRM_Utils_File::findFiles (from rubofvil) Note: According to http://php.net/glob, the return result varies by platform; sometimes it returns array(), and sometimes it returns FALSE. The patch should work with either case. ---------------------------------------- * CRM-13108: Warnings when extensions is installed http://issues.civicrm.org/jira/browse/CRM-13108 --- CRM/Utils/File.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index 44350a47d0..5d068bf18d 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -529,9 +529,11 @@ HTACCESS; $result = array(); while (!empty($todos)) { $subdir = array_shift($todos); - foreach (glob("$subdir/$pattern") as $match) { - if (!is_dir($match)) { - $result[] = $match; + if (is_array(glob("$subdir/$pattern"))) { + foreach (glob("$subdir/$pattern") as $match) { + if (!is_dir($match)) { + $result[] = $match; + } } } $dh = opendir($subdir); -- 2.25.1