Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-30496

Incorrect checking of upload server limit in WebService upload.php script

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 2.2
    • 2.1, 2.2
    • Web Services

      If you set Administration > Security -> Site policies -> Maximum uploaded file size to sever limit the $CFG>maxbytes setting will be set to 0, this will prevent any file to be uploaded

      Check:

      https://github.com/moodle/moodle/blob/master/webservice/upload.php#L111

      if (($_FILES[$fieldname]['size'] > $CFG->maxbytes)) {

      This will always return true, so you can't upload files

      I think this will fix the problem:

      if ($CFG->maxbytes && ($_FILES[$fieldname]['size'] > $CFG->maxbytes)) {

            jerome Jérôme Mouneyrac
            jleyva Juan Leyva
            Aparup Banerjee Aparup Banerjee
            Rossiani Wijaya Rossiani Wijaya
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.