Skip to content
Snippets Groups Projects
Commit 5dc21dd8 authored by Tim Otten's avatar Tim Otten
Browse files

Merge pull request #2489 from totten/4.4-restrictBrowsing-defensive

CRM-14092 - restrictBrowsing - Defensive programming
parents b3fe6f20 1305c22b
No related branches found
No related tags found
No related merge requests found
{* file to handle db changes in 4.4.5 during upgrade *}
......@@ -256,7 +256,7 @@ class CRM_Utils_Check_Security {
* @return bool
*/
public function isBrowsable($dir, $url) {
if (empty($dir) || empty($url)) {
if (empty($dir) || empty($url) || !is_dir($dir)) {
return FALSE;
}
......
......@@ -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)) {
......
......@@ -382,7 +382,7 @@ UNLOCK TABLES;
 
LOCK TABLES `civicrm_domain` WRITE;
/*!40000 ALTER TABLE `civicrm_domain` DISABLE KEYS */;
INSERT INTO `civicrm_domain` (`id`, `name`, `description`, `config_backend`, `version`, `contact_id`, `locales`, `locale_custom_strings`) VALUES (1,'Default Domain Name',NULL,NULL,'4.4.5',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
INSERT INTO `civicrm_domain` (`id`, `name`, `description`, `config_backend`, `version`, `contact_id`, `locales`, `locale_custom_strings`) VALUES (1,'Default Domain Name',NULL,NULL,'4.4.4',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
/*!40000 ALTER TABLE `civicrm_domain` ENABLE KEYS */;
UNLOCK TABLES;
 
<?xml version="1.0" encoding="iso-8859-1" ?>
<version>
<version_no>4.4.5</version_no>
<version_no>4.4.4</version_no>
</version>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment