Merge branch 'MDL-79617_master' of https://github.com/marxjohnson/moodle

This commit is contained in:
Huong Nguyen 2023-11-02 09:05:53 +07:00
commit 2a82f72385
2 changed files with 4 additions and 0 deletions

View File

@ -495,6 +495,8 @@ class dndupload_ajax_processor {
throw new moodle_exception('errornouploadrepo', 'moodle');
}
$repo = reset($repo); // Get the first (and only) upload repo.
// Pre-emptively purge the navigation cache so the upload repo can close the session.
navigation_cache::destroy_volatile_caches();
$details = $repo->process_upload(null, $maxbytes, $types, '/', $draftitemid);
if (empty($this->displayname)) {
$this->displayname = $this->display_name_from_file($details['file']);

View File

@ -82,6 +82,8 @@ class repository_upload extends repository {
$license = null, $author = '', $overwriteexisting = false, $areamaxbytes = FILE_AREA_MAX_BYTES_UNLIMITED) {
global $USER, $CFG;
\core\session\manager::write_close();
if ((is_array($types) and in_array('*', $types)) or $types == '*') {
$this->mimetypes = '*';
} else {