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

Uploading user profile image is broken

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3.1
    • Component/s: Repositories
    • Labels:
      None
    • Testing Instructions:
      Hide

      1. Edit user profile
      2. Drag and drop image file to user picture field
      3. Make sure it is dropped without erros
      4. Delete it and drag and drop non-image file
      5. Make sure file type error is displayed

      Show
      1. Edit user profile 2. Drag and drop image file to user picture field 3. Make sure it is dropped without erros 4. Delete it and drag and drop non-image file 5. Make sure file type error is displayed
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      wip-MDL-34117-master

      Description

      To reproduce attempt to drag and drop an image file to the user profile edit page (editadvanced.php). An error is produced...

      Image (GIF) filetype cannot be accepted.

      Analysis:
      The failure is in repository/upload/lib.php at line 183. This list of mimetypes ($this->mimetypes) appears to contain garbage.
      This list is generated from the 'accepted_types' array parameter on the editadvanced.php web form. This looks like the following...

      "accepted_types":"web_image"

      This is passed into process_upload as an array (in parameter $types). Each type (there is only 'web_image') is then sent through the function mimeinfo() a few lines down. This, for web_image returns 'document/unknown' which breaks the upload.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Jul/12