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

It's possible to bypass the maximum number of attachements by overloading the drag and drop option of the filepicker.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3.2
    • Component/s: Filepicker
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a forum and set maximum number of attachments to 3
      2. Create a discussion and drag in 3 files to the attachment
      3. Quickly drag in another file, whilst the original file upload is still processing
      4. Post to the forum

      Expected result - an error message, just above the attachments area, reading 'You must not attach more than 3 files here.'

      Note: you can make testing a lot easier by opening up repository/upload/lib.php, finding the 'process_upload' function and adding the line 'sleep(5);' at the start of it, to get the upload script to wait 5 seconds before responding.

      Show
      Create a forum and set maximum number of attachments to 3 Create a discussion and drag in 3 files to the attachment Quickly drag in another file, whilst the original file upload is still processing Post to the forum Expected result - an error message, just above the attachments area, reading 'You must not attach more than 3 files here.' Note: you can make testing a lot easier by opening up repository/upload/lib.php, finding the 'process_upload' function and adding the line 'sleep(5);' at the start of it, to get the upload script to wait 5 seconds before responding.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      MDL-33927_enforce_max_attachments

      Description

      Note: This works best when anti-virus software is enabled and scans uploaded files. This give you more time to drop in more files while it's loading the first batch.
      Replication steps

      1. Create a forum and set maximum number of attachments to 1 or more.
      2. create a discussion and drag in a number of files below the attachment limit. While it's processing those files, drag in another batch below the limit. This can be repeated multiple times. (I managed to drag in eight files in a two attachment limit forum).
      3. Post to the forum.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    10/Sep/12