Closed jessopb closed 5 years ago
I endorse cleaning this up on the path to filtering and/or as you're adding support for more types.
It seems decently likely that we'll want a file to carry around both it's media type and a higher-level category (like "image", "text" as you say).
If we need content-specific file size limit, I'd guess that category-based would be sufficient. However, if this adds any substantial complexity, I think a single global limit is fine.
The code is littered with tests for 'image/gif', or determinetype() or extension for 'type/ext'. Adding a new type support involves editing many files consistently. This should be centralized.