Skip to content

Commit

Permalink
MDL-14589 /. files are not created anymore when browsing empty areas,…
Browse files Browse the repository at this point in the history
… yay!
  • Loading branch information
skodak committed Sep 7, 2008
1 parent 4287fc0 commit a20c017
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/file/file_browser.php
Expand Up @@ -74,9 +74,13 @@ public function get_file_info($context, $filearea=null, $itemid=null, $filepath=
}
$urlbase = $CFG->wwwroot.'/draftfile.php';
if (!$storedfile = $fs->get_file($context->id, $filearea, $itemid, $filepath, $filename)) {
return null;
if ($filepath === '/' and $filename === '.') {
$storedfile = new virtual_root_file($context->id, $filearea, $itemid);
} else {
// not found
return null;
}
}
//something must create the top most directory
// TODO: localise
return new file_info_stored($this, $context, $storedfile, $urlbase, 'Draft file area', true, true, true);
}
Expand Down

0 comments on commit a20c017

Please sign in to comment.