Sorry, we don't support your browser.  Install a modern browser

Do not sanitize file extension#286

I have a file with the .jpeg file extension, but its corresponding media file ends up with .jpg. I had an issue with that and it took me a long time to debug, only to find out that Kirby does that intentionally here. Why? What’s the point of changing the file extension when that is not the actual file extension?

It makes sense to have the same file extension. If Kirby receives an invalid extension, it should throw an error, not silently do something unexpected.

a month ago

@Bastian Do you remember the reason for the sanitizeExtension() method? It’s been in the code unchanged for at least since 3.0.0, which makes it hard to track back to its origins.

@Hristiyan Dodov What was the issue you had with it that took you long to debug? I’m curious for more details to be able to find the best possible solution.

a month ago