Skip to content

Commit

Permalink
Merge branch 'MDL-58823-master' of git://github.com/jleyva/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed May 8, 2017
2 parents 48ad736 + fcdd773 commit 7167d25
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion repository/filesystem/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion repository/googledocs/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,8 @@ public function send_file($storedfile, $lifetime=null , $filter=0, $forcedownloa
}
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);
Expand Down
3 changes: 2 additions & 1 deletion repository/onedrive/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,8 @@ public function send_file($storedfile, $lifetime=null , $filter=0, $forcedownloa
$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);
Expand Down

0 comments on commit 7167d25

Please sign in to comment.