mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 17:02:03 +02:00
"MDL-25497, fixed Non-JavaScript file uploader generates warnings, credits to Tim Lock"
This commit is contained in:
parent
480f906e25
commit
75d138a312
@ -93,6 +93,12 @@ if ($repository = $DB->get_record_sql($sql, array($repo_id))) {
|
||||
}
|
||||
}
|
||||
|
||||
$moodle_maxbytes = get_max_upload_file_size();
|
||||
// to prevent maxbytes greater than moodle maxbytes setting
|
||||
if ($maxbytes == 0 || $maxbytes>=$moodle_maxbytes) {
|
||||
$maxbytes = $moodle_maxbytes;
|
||||
}
|
||||
|
||||
$params = array('ctx_id' => $contextid, 'itemid' => $itemid, 'env' => $env, 'course'=>$courseid, 'maxbytes'=>$maxbytes, 'maxfiles'=>$maxfiles, 'subdirs'=>$subdirs, 'sesskey'=>sesskey());
|
||||
$params['action'] = 'browse';
|
||||
$params['draftpath'] = $draftpath;
|
||||
@ -107,7 +113,7 @@ switch ($action) {
|
||||
case 'upload':
|
||||
// The uploaded file has been processed in plugin construct function
|
||||
// redirect to default page
|
||||
$repo->upload();
|
||||
$repo->upload('', $maxbytes);
|
||||
redirect($home_url, get_string('uploadsucc','repository'));
|
||||
break;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user