Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'MDL-29835_24' of git://github.com/pauln/moodle into MOO…

…DLE_24_STABLE
  • Loading branch information...
commit 391e361387363e629cf3e85a8c87d70e5bcecd91 2 parents 03e6343 + 3dcd751
@danpoltawski danpoltawski authored
Showing with 4 additions and 2 deletions.
  1. +2 −1  lib/form/dndupload.js
  2. +2 −1  lib/form/filemanager.php
View
3  lib/form/dndupload.js
@@ -537,7 +537,8 @@ M.form_dndupload.init = function(Y, options) {
if (!overwrite) {
this.currentfilecount++;
}
- if (this.options.maxfiles > 0 && this.currentfilecount > this.options.maxfiles) {
+ // The value for "unlimited files" is -1, so 0 should mean 0.
+ if (this.options.maxfiles >= 0 && this.currentfilecount > this.options.maxfiles) {
// Too many files - abort entire upload.
this.uploadqueue = [];
this.renamequeue = [];
View
3  lib/form/filemanager.php
@@ -332,7 +332,8 @@ public function __construct(stdClass $options) {
$defaults['defaultlicense'] = $CFG->sitedefaultlicense;
}
foreach ($defaults as $key=>$value) {
- if (empty($options->$key)) {
+ // Using !isset() prevents us from overwriting falsey values with defaults (as empty() did).
+ if (!isset($options->$key)) {
$options->$key = $value;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.