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

zip_archive should ignore system files

XMLWordPrintable

    • MOODLE_24_STABLE, MOODLE_25_STABLE
    • MOODLE_26_STABLE
    • MDL-39339_master
    • Hide
      • Ensure that you have the PHP INTL extension installed (the OSX test zip requires it to standardise unicode)
      • Run the zip_packer unit tests (lib/filestorage/tests/zip_packer_test.php)
      • Drag and drop lib/filestorage/tests/fixtures/test_osx_compress.zip into a Moodle course, choosing to extract it to create a Folder
      • Confirm that the resulting Folder does not contain a __MACOSX folder or any .DS_Store files
      • Drag and drop lib/filestorage/tests/fixtures/test_thumbsdb.zip into a Moodle course, choosing to extract it to create a Folder
      • Confirm that the resulting Folder does not contain a Thumbs.db file

      If you have access to a Mac and/or a computer running WinXP, you can also create and test your own zip files. WinXP requires that thumbnail caching be enabled, and you can then trigger creation of Thumbs.db files by opening a folder containing images (JPG works, and some other formats may too). OSX is a bit trickier; you need to open a folder in Finder, move the Finder window around and resize it, change the view mode and then hold your tongue in the right position while you zip the folder up ("Compress" from the context menu).

      Show
      Ensure that you have the PHP INTL extension installed (the OSX test zip requires it to standardise unicode) Run the zip_packer unit tests (lib/filestorage/tests/zip_packer_test.php) Drag and drop lib/filestorage/tests/fixtures/test_osx_compress.zip into a Moodle course, choosing to extract it to create a Folder Confirm that the resulting Folder does not contain a __MACOSX folder or any .DS_Store files Drag and drop lib/filestorage/tests/fixtures/test_thumbsdb.zip into a Moodle course, choosing to extract it to create a Folder Confirm that the resulting Folder does not contain a Thumbs.db file If you have access to a Mac and/or a computer running WinXP, you can also create and test your own zip files. WinXP requires that thumbnail caching be enabled, and you can then trigger creation of Thumbs.db files by opening a folder containing images (JPG works, and some other formats may too). OSX is a bit trickier; you need to open a folder in Finder, move the Finder window around and resize it, change the view mode and then hold your tongue in the right position while you zip the folder up ("Compress" from the context menu).

      The zip_archive class should ignore OS files like

      • Thumbs.db (Windows)
      • .DS_Store (Mac OS)
      • __MACOSX (Mac OS)
      • Possibly others, but nobody seems to know of any right now (and no good list has been found)

      as typical users do not see these files or know that they exist. Their presence in uploaded zip files may cause issues in some automated processing situations, or may cause confusion for users who do not know what they are or where they have come from.

      This will be beneficial in places such as:

      • Folder drag/drop (drop a zip in and extract to a Folder resource)
      • Uploading and extracting zip files into file managers / file pickers
      • Bulk-uploading feedback files for assignments (particularly useful in conjunction with MDL-39359 - OSX tends to put its files in the root of the zip, which can mess up the checks done there)
      • Anywhere else that zip_archive is used

            paul.n Paul Nicholls
            timhunt Tim Hunt
            Petr Skoda Petr Skoda
            Dan Poltawski Dan Poltawski
            Jason Fowler Jason Fowler
            Votes:
            8 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.