Bug description
Clicking "Import" on Commons when trying to import the following file gives "Fatal exception of type RuntimeException". File extension in page title is png and non-matching mime type is gif.
I was able to import the following file after changing the file extension in page title beforehand.
Acceptance Criteria
- If a file's extension and the actual MIME type are not matching, redirect the moving person straight to the blocking error page
- The error displayed is mediawiki core's filetype-mime-mismatch
Notes
Other ideas to solve the issues:
- file extension could be changed automatically
- FileImporter could allow changing it manually during the import, in case it isn't correct and the actual file type is permitted.
There is a somewhat related task (T185735) on error handling for file extensions that are correct, but not permitted for uploads.
Previous specialized wording of the error message:
The extension of the file you are importing (.png) does not match its MIME type (gif). To fix this, rename the original file so that it ends in .gif. This is usually done by admins. After that, you can try another import."
The error message contains the appropriate extension and MIME type explanations (in the example given above ".png" and "gif")