MDL-41337 files: Fixed bug with accidental delete of the root directory

This commit is contained in:
Marina Glancy 2013-10-29 16:56:20 +11:00
parent 68291f2d57
commit d90c811585
3 changed files with 37 additions and 2 deletions

View file

@ -832,7 +832,7 @@ function file_save_draft_area_files($draftitemid, $contextid, $component, $filea
$newhashes = array();
$filecount = 0;
foreach ($draftfiles as $file) {
if (!$options['subdirs'] && ($file->get_filepath() !== '/' or $file->is_directory())) {
if (!$options['subdirs'] && $file->get_filepath() !== '/') {
continue;
}
if (!$allowreferences && $file->is_external_file()) {