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

Extension of uploaded file changes due to multiple dots in the filename

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.1
    • 2.5
    • Files API, Repositories
    • centos 5.x x86_64, postgres 8.4, apache 2.2.x php 5.3.x
    • PostgreSQL
    • MOODLE_21_STABLE
    • MOODLE_25_STABLE
    • MDL-29749-master-4th
    • Hide

      Rename the file after uploading, then the multiple dots work again.

      Show
      Rename the file after uploading, then the multiple dots work again.
    • Hide

      Test pre-requisites

      • Feel destructive
      • Create the following files:
        • myfile...txt
        • myfile.f..txt
        • myfile..f.txt
        • . . .txt
        • blah.jpg...
      • Create a few other files with random dots inside.

      Test steps

      1. Go to your private files
      2. Upload the above created files
      3. Make sure each file keeps its original extension
      4. Make sure the file names are cleaned up as expected
      5. Upload the attached zip file `funkynames.zip`, and unzip it
      6. Make sure the files and folders names are as the originals (you'll have to click on each file/folder to check the white spaces)
      Show
      Test pre-requisites Feel destructive Create the following files: myfile...txt myfile.f..txt myfile..f.txt . . .txt blah.jpg... Create a few other files with random dots inside. Test steps Go to your private files Upload the above created files Make sure each file keeps its original extension Make sure the file names are cleaned up as expected Upload the attached zip file `funkynames.zip`, and unzip it Make sure the files and folders names are as the originals (you'll have to click on each file/folder to check the white spaces)

    Description

      What happens:
      -------------------------------------------
      Let's assume we have a filename with multiple dots at the end of the filename before the extension, like for example foo_bar_e.g..txt
      (the e.g. has a dot at the end and the dot of the extension follows). After the fileupload with the upload repository, the file is stored as foo_bar_e.gtxt.

      Expected Behaviour:
      -------------------------------------------
      Filenames with mutliple dots should be uploaded faithfully (as long as the filename is valid, of course).

      Remark:
      -------------------------------------------
      This is especially a problem if the multiple dots are near the extension so that the extension changes. If - for example - an extension changes from .a..pdf to .apdf, then the file is no longer identified as a pdf file and users are left confused.

      Replication steps:
      a.) Generate a file with multiple dots near the extension (examples: foo..bar.gz or foor_bar.e.g..pdf)
      b.) Upload using the upload repository
      c.) find the extension changed

      Attachments

        1. mdl-32370_22.patch
          1 kB
        2. funkynames.zip
          1.0 kB
        3. dots & spaces.zip
          3 kB

        Issue Links

          Activity

            People

              fred Frédéric Massart
              martinschwinzerl Martin Schwinzerl
              Rajesh Taneja Rajesh Taneja
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Jason Fowler Jason Fowler
              Matteo Scaramuccia, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                14/May/13