Permalink
Browse files

"MDL-25497, fixed Non-JavaScript file uploader generates warnings, cr…

…edits to Tim Lock"
  • Loading branch information...
1 parent 480f906 commit 75d138a312bede383fdea8b89431d27456aab8b4 @dcai dcai committed Dec 2, 2010
Showing with 7 additions and 1 deletion.
  1. +7 −1 repository/filepicker.php
@@ -93,6 +93,12 @@
}
}
+$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 @@
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;

0 comments on commit 75d138a

Please sign in to comment.