create safer .htaccess SC#302; backported from HEAD

This commit is contained in:
skodak
2006-08-28 21:13:12 +00:00
parent 4e2cbb28e5
commit 0eeec1a96f
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -871,7 +871,7 @@ function main_upgrade($oldversion=0) {
if ($oldversion < 2005011000) { // Create a .htaccess file in dataroot, just in case
if (!file_exists($CFG->dataroot.'/.htaccess')) {
if ($handle = fopen($CFG->dataroot.'/.htaccess', 'w')) { // For safety
@fwrite($handle, "deny from all\r\n");
@fwrite($handle, "deny from all\r\nAllowOverride None\r\n");
@fclose($handle);
notify("Created a default .htaccess file in $CFG->dataroot");
}