Skip to content

Commit 3a93590

Browse files
authored
Update helpers.php
1 parent f09a7b1 commit 3a93590

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

inc/helpers.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@ function rrmdir($dir) {
5353
file_put_contents($htaccessPathUpload, $htaccessContent);
5454
}
5555

56+
// Generate .htaccess for inc-Folder (deny direct access)
57+
$htaccessPathInc = $incDir . '/.htaccess';
58+
if (!file_exists($htaccessPathInc)) {
59+
$htaccessContent = <<<HTACCESS
60+
# Prevent direct access to files
61+
Order deny,allow
62+
Deny from all
63+
HTACCESS;
64+
65+
file_put_contents($htaccessPathInc, $htaccessContent);
66+
}
67+
5668
// Generate .htaccess for .env-Folder (deny direct access)
5769
$htaccessPathEnv = $envDir . '/.htaccess';
5870
if (!file_exists($htaccessPathEnv)) {
@@ -163,4 +175,4 @@ function sendSMTPMail(
163175
}
164176

165177
return true;
166-
}
178+
}

0 commit comments

Comments
 (0)