Skip to content

Commit

Permalink
MDL-83674 Files: pluginfile.php debugging if user not allowed course
Browse files Browse the repository at this point in the history
  • Loading branch information
sammarshallou committed Nov 8, 2024
1 parent cd5c991 commit ad4bd33
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pluginfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,12 @@
// The repository may have to export the file to an offline format.
$offline = optional_param('offline', 0, PARAM_BOOL);
$embed = optional_param('embed', 0, PARAM_BOOL);

// We need to set the page URL here because there are cases where file_pluginfile may display an
// error directly on the page instead of throwing an exception, and this will generate a server
// error if $PAGE->url is not defined.
if (!$PAGE->has_set_url()) {
$PAGE->set_url($FULLME);
}

file_pluginfile($relativepath, $forcedownload, $preview, $offline, $embed);

0 comments on commit ad4bd33

Please sign in to comment.