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

Improve file name cleaning when file export/serving/zipping

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Do
    • 2.6
    • None
    • Files API
    • MOODLE_26_STABLE

    Description

      PARAM_FILE has been designed to remove dangerous characters or patterns from file names. It would be a good idea to create a function which cleans up file names so that they're compliant with most platforms.

      This does not imply to strip out all characters but [a-z0-9_.-] but to replace some illegal ones with an underscore (? / \ *, etc ...) and to trim the extract spaces.

      Zipping files is probably the trickiest part as we could end up with multiple files having the same name. We could also break things like an HTML document if those funky file names were used as references, but what can we do about it?

      Attachments

        Issue Links

          Activity

            People

              moodle.com Moodle HQ
              fred Frédéric Massart
              Matteo Scaramuccia, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: