Skip to content

Commit e70b243

Browse files
committed
Disable access to app/cache + allow pchart generated files BT#18720
1 parent fcb8bfc commit e70b243

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Diff for: app/cache/.htaccess

+7
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1+
order deny,allow
2+
deny from all
3+
# pChart generated files should be allowed
4+
<FilesMatch "^[0-9a-f]+$">
5+
order allow,deny
6+
allow from all
7+
</FilesMatch>
18
php_flag engine off

Diff for: main/admin/archive_cleanup.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,17 @@
4646
}
4747

4848
$archive_path = api_get_path(SYS_ARCHIVE_PATH);
49-
$htaccess = 'php_flag engine off';
49+
$htaccess = <<<TEXT
50+
order deny,allow
51+
deny from all
52+
# pChart generated files should be allowed
53+
<FilesMatch "^[0-9a-f]+$">
54+
order allow,deny
55+
allow from all
56+
</FilesMatch>
57+
php_flag engine off
58+
TEXT;
59+
5060
$result = rmdirr($archive_path, true, true);
5161
if (false === $result) {
5262
Display::addFlash(Display::return_message(get_lang('ArchiveDirCleanupFailed'), 'error'));

0 commit comments

Comments
 (0)