Merged from MOODLE_15_STABLE: Fixing bug#4659 - don't make upload directories unless there's something to save

This commit is contained in:
mjollnir_
2006-02-01 20:01:50 +00:00
parent 4128597a44
commit 3abd1a5552
+7
View File
@@ -142,6 +142,7 @@ class upload_manager {
}
$this->files[$name]['name'] = $newname;
$this->files[$name]['clear'] = true; // ok to save.
$this->config->somethingtosave = true;
}
}
}
@@ -187,6 +188,12 @@ class upload_manager {
if (!$this->status) { // preprocess_files hasn't been run
$this->preprocess_files();
}
// if there are no files, bail before we create an empty directory.
if (empty($this->config->somethingtosave)) {
return true;
}
if ($this->status) {
if (!(strpos($destination, $CFG->dataroot) === false)) {
// take it out for giving to make_upload_directory