Skip to content

Commit

Permalink
"MDL-25497, fixed Non-JavaScript file uploader generates warnings, cr…
Browse files Browse the repository at this point in the history
…edits to Tim Lock"
  • Loading branch information
Dongsheng Cai committed Dec 2, 2010
1 parent 480f906 commit 75d138a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion repository/filepicker.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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 = array('ctx_id' => $contextid, 'itemid' => $itemid, 'env' => $env, 'course'=>$courseid, 'maxbytes'=>$maxbytes, 'maxfiles'=>$maxfiles, 'subdirs'=>$subdirs, 'sesskey'=>sesskey());
$params['action'] = 'browse'; $params['action'] = 'browse';
$params['draftpath'] = $draftpath; $params['draftpath'] = $draftpath;
Expand All @@ -107,7 +113,7 @@
case 'upload': case 'upload':
// The uploaded file has been processed in plugin construct function // The uploaded file has been processed in plugin construct function
// redirect to default page // redirect to default page
$repo->upload(); $repo->upload('', $maxbytes);
redirect($home_url, get_string('uploadsucc','repository')); redirect($home_url, get_string('uploadsucc','repository'));
break; break;


Expand Down

0 comments on commit 75d138a

Please sign in to comment.