Merge branch 'MDL-58823-master' of git://github.com/jleyva/moodle

This commit is contained in:
Andrew Nicols 2017-05-08 09:32:58 +08:00
commit 7167d25f5f
3 changed files with 6 additions and 3 deletions

View File

@ -845,7 +845,8 @@ function repository_filesystem_pluginfile($course, $cm, $context, $filearea, $ar
// Find stored or generated thumbnail.
if (!($file = $repo->get_thumbnail($filepath, $filearea))) {
// Generation failed, redirect to default icon for file extension.
redirect($OUTPUT->image_url(file_extension_icon($file, 90)));
// Do not use redirect() here because is not compatible with webservice/pluginfile.php.
header('Location: ' . $OUTPUT->image_url(file_extension_icon($file, 90)));
}
// The thumbnails should not be changing much, but maybe the default lifetime is too long.
$lifetime = $CFG->filelifetime;

View File

@ -636,7 +636,8 @@ class repository_googledocs extends repository {
}
send_file($downloaded['path'], $filename, $lifetime, $filter, false, $forcedownload, '', false, $options);
} else if ($source->link) {
redirect($source->link);
// Do not use redirect() here because is not compatible with webservice/pluginfile.php.
header('Location: ' . $source->link);
} else {
$details = 'File is missing source link';
throw new repository_exception('errorwhilecommunicatingwith', 'repository', '', $details);

View File

@ -583,7 +583,8 @@ class repository_onedrive extends repository {
$filename = $storedfile->get_filename();
send_file($downloaded['path'], $filename, $lifetime, $filter, false, $forcedownload, '', false, $options);
} else if ($source->link) {
redirect($source->link);
// Do not use redirect() here because is not compatible with webservice/pluginfile.php.
header('Location: ' . $source->link);
} else {
$details = 'File is missing source link';
throw new repository_exception('errorwhilecommunicatingwith', 'repository', '', $details);