Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Move file/mimetypes #762

ghengeveld opened this Issue Dec 1, 2011 · 2 comments


None yet
3 participants

ghengeveld commented Dec 1, 2011

Currently known file extensions and mimetypes are stored in datas/extensions.php and datas/mimetypes.php. There's two issues with this:

  • The files are overwritten when upgrading, undoing any changes an admin may have done. This could potentially become a security risk if the admin is not aware. This issue is most easily fixed by storing this info in the database.
  • File- and mimetypes are a PFS feature, but are currently not packaged with that module. We should decide whether to make it a global config or part of PFS.

Kilandor commented Dec 1, 2011

Mimetype is used in system/uploads.php

Extensions is also used for the page modules for downloads to select an appropriate icon if possible.

So neither is completely exclusive to PFS. I don't think merging the 2 would be best either for simplicity sake. Extension is a simple thing anyone can use for handling the icons for pages etc. Mimetype is a highly advanced and technical feature, which may feel overwhelming to a use simply trying to add an icon.

I would recommend moving the default ext/mime to system or somewhere else possibly. Then we can still load these as default then after it load custom config a user can create from datas. This also could have a config similar to custom PFS to load or not attempt to load the custom files.

I originally played with using a database for mimetypes but opted against it. Due to being slightly slower and being something that is likely never to be frequently modified.

The string names in uploads for lang and cfg could likely be renamed to better suit its use now.

@trustmaster trustmaster added the minor label Sep 20, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment