Merge branch 'w51_MDL-30621_m22_protectdir' of git://github.com/skodak/moodle into MOODLE_22_STABLE
This commit is contained in:
+12
-2
@@ -1193,7 +1193,12 @@ function make_upload_directory($directory, $exceptiononerror = true) {
|
||||
*/
|
||||
function make_temp_directory($directory, $exceptiononerror = true) {
|
||||
global $CFG;
|
||||
protect_directory($CFG->tempdir);
|
||||
if ($CFG->tempdir !== "$CFG->dataroot/temp") {
|
||||
check_dir_exists($CFG->tempdir, true, true);
|
||||
protect_directory($CFG->tempdir);
|
||||
} else {
|
||||
protect_directory($CFG->dataroot);
|
||||
}
|
||||
return make_writable_directory("$CFG->tempdir/$directory", $exceptiononerror);
|
||||
}
|
||||
|
||||
@@ -1206,7 +1211,12 @@ function make_temp_directory($directory, $exceptiononerror = true) {
|
||||
*/
|
||||
function make_cache_directory($directory, $exceptiononerror = true) {
|
||||
global $CFG;
|
||||
protect_directory($CFG->cachedir);
|
||||
if ($CFG->cachedir !== "$CFG->dataroot/cache") {
|
||||
check_dir_exists($CFG->cachedir, true, true);
|
||||
protect_directory($CFG->cachedir);
|
||||
} else {
|
||||
protect_directory($CFG->dataroot);
|
||||
}
|
||||
return make_writable_directory("$CFG->cachedir/$directory", $exceptiononerror);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user