Skip to content

Commit 11a04bb

Browse files
committed
Update default htaccess file
1 parent 650b655 commit 11a04bb

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

rainloop/v/0.0.0/app/.htaccess

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
Deny from all
1+
<IfModule mod_version.c>
2+
<IfVersion < 2.4>
3+
Deny from All
4+
</IfVersion>
5+
<IfVersion >= 2.4>
6+
Require all denied
7+
</IfVersion>
8+
</IfModule>
9+
<IfModule !mod_version.c>
10+
<IfModule !mod_authz_core.c>
11+
Deny from all
12+
</IfModule>
13+
<IfModule mod_authz_core.c>
14+
Require all denied
15+
</IfModule>
16+
</IfModule>
17+
<IfModule mod_autoindex.c>
18+
Options -Indexes
19+
</ifModule>

rainloop/v/0.0.0/include.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
define('APP_VERSION_ROOT_PATH', APP_INDEX_ROOT_PATH.'rainloop/v/'.APP_VERSION.'/');
1717

1818
define('APP_USE_APC_CACHE', true);
19-
define('APP_DEFAULT_DENY_ALL_HTACCESS', "Deny from all\n<IfModule mod_autoindex.c>\nOptions -Indexes\n</ifModule>");
19+
define('APP_DEFAULT_DENY_ALL_HTACCESS', @file_exists(APP_VERSION_ROOT_PATH.'app/.htaccess') ?
20+
@file_get_contents(APP_VERSION_ROOT_PATH.'app/.htaccess') : '');
2021

2122
if (function_exists('date_default_timezone_set'))
2223
{
@@ -150,7 +151,9 @@
150151
@file_put_contents(APP_DATA_FOLDER_PATH.'VERSION', APP_VERSION);
151152
@file_put_contents(APP_DATA_FOLDER_PATH.'index.html', 'Forbidden');
152153
@file_put_contents(APP_DATA_FOLDER_PATH.'index.php', 'Forbidden');
153-
@file_put_contents(APP_DATA_FOLDER_PATH.'.htaccess', APP_DEFAULT_DENY_ALL_HTACCESS);
154+
if (0 < strlen(APP_DEFAULT_DENY_ALL_HTACCESS)) {
155+
@file_put_contents(APP_DATA_FOLDER_PATH.'.htaccess', APP_DEFAULT_DENY_ALL_HTACCESS);
156+
}
154157

155158
if (!@is_dir(APP_PRIVATE_DATA))
156159
{

0 commit comments

Comments
 (0)