Skip to content

Commit

Permalink
"MDL-13766, maxbytes should not be 0"
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongsheng Cai committed Apr 30, 2010
1 parent 0f1e391 commit b8cea71
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion repository/repository_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
$source = optional_param('source', '', PARAM_RAW); // file to download
$itemid = optional_param('itemid', 0, PARAM_INT);
$page = optional_param('page', '', PARAM_RAW); // page
$maxbytes = optional_param('maxbytes', -1, PARAM_INT);
$maxbytes = optional_param('maxbytes', 0, PARAM_INT);
$req_path = optional_param('p', '', PARAM_RAW); // path
$saveas_filearea = optional_param('filearea', 'user_draft', PARAM_TEXT);
$saveas_filename = optional_param('title', '', PARAM_FILE); // new file name
Expand All @@ -59,6 +59,10 @@
$err = new stdclass;
$err->client_id = $client_id;

if ($maxbytes == 0) {
$maxbytes = get_max_upload_file_size();
}

/// Check permissions
if (! (isloggedin() && repository::check_context($contextid)) ) {
$err->e = get_string('nopermissiontoaccess', 'repository');
Expand Down

0 comments on commit b8cea71

Please sign in to comment.