CRM_Utils_File::findFiles() - Fail gracefully if directory doesn't exist
authorTim Otten <totten@civicrm.org>
Mon, 8 Feb 2016 22:32:15 +0000 (22:32 +0000)
committerTim Otten <totten@civicrm.org>
Mon, 8 Feb 2016 22:32:15 +0000 (22:32 +0000)
CRM/Utils/File.php

index f869d7604ef9f592331d2a0c10844ff7f0875989..1e17d78e8007eb57042a040010ffc70e80c31606 100644 (file)
@@ -663,6 +663,9 @@ HTACCESS;
    * @return array(string)
    */
   public static function findFiles($dir, $pattern, $relative = FALSE) {
+    if (!is_dir($dir)) {
+      return array();
+    }
     $dir = rtrim($dir, '/');
     $todos = array($dir);
     $result = array();