projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0360fb6
)
CRM-14092 - restrictBrowsing - Defensive programming
author
Tim Otten
<totten@civicrm.org>
Thu, 6 Feb 2014 23:19:03 +0000
(15:19 -0800)
committer
Tim Otten
<totten@civicrm.org>
Thu, 6 Feb 2014 23:19:03 +0000
(15:19 -0800)
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
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Utils/File.php
b/CRM/Utils/File.php
index 1e4aee46244bdb0dd54c606a7370e5b080bb9f94..97b54fa5ff9af320b9c0aa14f71fad8d3f5e2ecc 100644
(file)
--- 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)) {