From: Tim Otten Date: Thu, 6 Feb 2014 23:19:03 +0000 (-0800) Subject: CRM-14092 - restrictBrowsing - Defensive programming X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9404eeac721984ce0aa19e9e2d6cac9028d45717;p=civicrm-core.git CRM-14092 - restrictBrowsing - Defensive programming It's OK if restrictBrowsing fails -- because we'll still perform a behavioral test and alert admin if browsing is enabled. --- diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index 1e4aee4624..97b54fa5ff 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -407,6 +407,10 @@ HTACCESS; * @param $publicDir */ static function restrictBrowsing($publicDir) { + if (!is_dir($publicDir) || !is_writable($publicDir)) { + return; + } + // base dir $nobrowse = realpath($publicDir) . '/index.html'; if (!file_exists($nobrowse)) {