From 9404eeac721984ce0aa19e9e2d6cac9028d45717 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 6 Feb 2014 15:19:03 -0800 Subject: [PATCH] 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. --- CRM/Utils/File.php | 4 ++++ 1 file changed, 4 insertions(+) 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)) { -- 2.25.1