Skip to content
Browse files

Merge branch 'w51_MDL-30621_m22_protectdir' of git://github.com/skoda…

…k/moodle into MOODLE_22_STABLE
  • Loading branch information...
2 parents b750cfd + f9c5bd9 commit e79c09855ca853fab61d88b3f8d2a71e1fc8411b Sam Hemelryk committed Dec 13, 2011
Showing with 12 additions and 2 deletions.
  1. +12 −2 lib/setuplib.php
View
14 lib/setuplib.php
@@ -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);
}

0 comments on commit e79c098

Please sign in to comment.
Something went wrong with that request. Please try again.