mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
If we create a directory, then chmod it to protect the contents.
This commit is contained in:
parent
3c72e2f9c9
commit
fe2874294c
1 changed files with 3 additions and 0 deletions
|
@ -751,11 +751,13 @@ function make_upload_directory($directory) {
|
||||||
global $CFG;
|
global $CFG;
|
||||||
|
|
||||||
$currdir = $CFG->dataroot;
|
$currdir = $CFG->dataroot;
|
||||||
|
|
||||||
if (!file_exists($currdir)) {
|
if (!file_exists($currdir)) {
|
||||||
if (! mkdir($currdir, 0750)) {
|
if (! mkdir($currdir, 0750)) {
|
||||||
notify("ERROR: You need to create the directory $currdir with web server write access");
|
notify("ERROR: You need to create the directory $currdir with web server write access");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
chmod($currdir,0750);
|
||||||
}
|
}
|
||||||
|
|
||||||
$dirarray = explode("/", $directory);
|
$dirarray = explode("/", $directory);
|
||||||
|
@ -767,6 +769,7 @@ function make_upload_directory($directory) {
|
||||||
notify("ERROR: Could not find or create a directory ($currdir)");
|
notify("ERROR: Could not find or create a directory ($currdir)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
chmod($currdir,0750);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue