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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1, 2.2
    • Fix Version/s: 2.2
    • Component/s: Web Services
    • Labels:

      Description

      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)) {

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jerome Jérôme Mouneyrac
              Reporter:
              jleyva Juan Leyva
              Integrator:
              Aparup Banerjee
              Tester:
              Rossiani Wijaya
              Participants:
              Component watchers:
              Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                5/Dec/11