MDL-22950 fixed regression - files in subdirectories not found; big thanks to Dongsheng for spotting this

This commit is contained in:
Petr Skoda 2010-07-07 07:53:03 +00:00
parent c393165495
commit d85ab7051c
2 changed files with 18 additions and 18 deletions

View file

@ -38,7 +38,7 @@ function block_html_pluginfile($course, $birecord_or_cm, $context, $filearea, $a
$fs = get_file_storage();
$filename = array_pop($args);
$filepath = '/'.implode('/', $args);
$filepath = $args ? '/'.implode('/', $args).'/' : '/';
if (!$file = $fs->get_file($context->id, 'block_html', 'content', 0, $filepath, $filename) or $file->is_directory()) {
send_file_not_found();