From: Tim Otten Date: Mon, 8 Feb 2016 22:32:15 +0000 (+0000) Subject: CRM_Utils_File::findFiles() - Fail gracefully if directory doesn't exist X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=cae27189b26c622b7900e959d041e1c1d1e9644a;p=civicrm-core.git CRM_Utils_File::findFiles() - Fail gracefully if directory doesn't exist --- diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index f869d7604e..1e17d78e80 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -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();