Make sure .htaccess is created in dataroot, just in case

This commit is contained in:
moodler
2006-08-18 09:54:09 +00:00
parent cdb46b63d2
commit d100b8a04d
+4
View File
@@ -55,6 +55,10 @@ function make_upload_directory($directory, $shownotices=true) {
}
return false;
}
}
// Make sure a .htaccess file is here, JUST IN CASE the files area is in the open
if (!file_exists($currdir.'/.htaccess')) {
if ($handle = fopen($currdir.'/.htaccess', 'w')) { // For safety
@fwrite($handle, "deny from all\r\n");
@fclose($handle);