Commit 74a41e4e authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1234615: Check that resized image files are viewable by user"

parents c2460f76 aa31ba59
...@@ -934,6 +934,7 @@ class HtmlExportOutputFilter { ...@@ -934,6 +934,7 @@ class HtmlExportOutputFilter {
* will be placed * will be placed
*/ */
private function get_export_path_for_file(ArtefactTypeFileBase $file, array $options, $basefolder=null) { private function get_export_path_for_file(ArtefactTypeFileBase $file, array $options, $basefolder=null) {
global $SESSION;
if (is_null($basefolder)) { if (is_null($basefolder)) {
if ($file->get('owner') == $this->owner) { if ($file->get('owner') == $this->owner) {
$basefolder = '/files/file/' . $this->get_folder_path_for_file($file); $basefolder = '/files/file/' . $this->get_folder_path_for_file($file);
...@@ -944,9 +945,12 @@ class HtmlExportOutputFilter { ...@@ -944,9 +945,12 @@ class HtmlExportOutputFilter {
} }
unset($options['view']); unset($options['view']);
if (!$this->exporter->get('user')->can_view_artefact($file)) {
$SESSION->add_info_msg(get_string('unabletocopyartefact', 'export', $file->get('title')));
return '';
}
$prefix = ''; $prefix = '';
$title = PluginExportHtml::sanitise_path($file->get('title')); $title = PluginExportHtml::sanitise_path($file->get('title'));
if ($options) { if ($options) {
list($size, $prefix) = $this->get_size_from_options($options); list($size, $prefix) = $this->get_size_from_options($options);
$from = $file->get_path($size); $from = $file->get_path($size);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment