MDL-68435 customfield: fix plugin file serving callbacks.

Incorrect parameter/method call was previously serving files with
wrong filenames.
This commit is contained in:
Paul Holden 2023-08-25 10:46:33 +01:00
parent 206c3a66e7
commit 08e66a5691
No known key found for this signature in database
GPG Key ID: A81A96D6045F6164
2 changed files with 2 additions and 3 deletions

View File

@ -72,5 +72,5 @@ function customfield_textarea_pluginfile($course, $cm, $context, $filearea, $arg
}
// We can now send the file back to the browser - in this case with a cache lifetime of 1 day and no filtering.
send_file($file, 86400, 0, $forcedownload, $options);
send_stored_file($file, DAYSECS, 0, $forcedownload, $options);
}

View File

@ -82,6 +82,5 @@ function core_customfield_pluginfile($course, $cm, $context, $filearea, $args, $
}
// We can now send the file back to the browser - in this case with a cache lifetime of 1 day and no filtering.
// From Moodle 2.3, use send_stored_file instead.
send_file($file, 86400, 0, $forcedownload, $options);
send_stored_file($file, DAYSECS, 0, $forcedownload, $options);
}