Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…edits to Tim Lock"
  • Loading branch information...
commit 75d138a312bede383fdea8b89431d27456aab8b4 1 parent 480f906
Dongsheng Cai dongsheng authored

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. +7 1 repository/filepicker.php
8 repository/filepicker.php
@@ -93,6 +93,12 @@
93 93 }
94 94 }
95 95
  96 +$moodle_maxbytes = get_max_upload_file_size();
  97 +// to prevent maxbytes greater than moodle maxbytes setting
  98 +if ($maxbytes == 0 || $maxbytes>=$moodle_maxbytes) {
  99 + $maxbytes = $moodle_maxbytes;
  100 +}
  101 +
96 102 $params = array('ctx_id' => $contextid, 'itemid' => $itemid, 'env' => $env, 'course'=>$courseid, 'maxbytes'=>$maxbytes, 'maxfiles'=>$maxfiles, 'subdirs'=>$subdirs, 'sesskey'=>sesskey());
97 103 $params['action'] = 'browse';
98 104 $params['draftpath'] = $draftpath;
@@ -107,7 +113,7 @@
107 113 case 'upload':
108 114 // The uploaded file has been processed in plugin construct function
109 115 // redirect to default page
110   - $repo->upload();
  116 + $repo->upload('', $maxbytes);
111 117 redirect($home_url, get_string('uploadsucc','repository'));
112 118 break;
113 119

0 comments on commit 75d138a

Please sign in to comment.
Something went wrong with that request. Please try again.