Last modified: 2014-02-12 23:32:47 UTC
Since updating to 1.17rc1 today, file uploads of types for which there is not a particular mime-type (in my case, ".dem" files, which are demo files from Valve's Source Engine games). Image uploads work fine. Additionally, attempting to move already-uploaded .dem files, without changing the .dem extension, cause the error "The new file extension does not match its type" to appear (and the file doesn't move). Output: key 'fw9re1ay7wwdqf7p4c4eiyupmxwdezn.' is not in a proper format Backtrace: #0 /home/pwiki/www/w/includes/upload/UploadBase.php(634): UploadStash->stashFile('/tmp/phpNsK1a1', Array, NULL) #1 /home/pwiki/www/w/includes/upload/UploadBase.php(646): UploadBase->stashSessionFile(NULL) #2 /home/pwiki/www/w/includes/specials/SpecialUpload.php(367): UploadBase->stashSession() #3 /home/pwiki/www/w/includes/specials/SpecialUpload.php(461): SpecialUpload->showUploadWarning(Array) #4 /home/pwiki/www/w/includes/specials/SpecialUpload.php(192): SpecialUpload->processUpload() #5 /home/pwiki/www/w/includes/SpecialPage.php(578): SpecialUpload->execute(NULL) #6 /home/pwiki/www/w/includes/Wiki.php(251): SpecialPage::executePath(Object(Title)) #7 /home/pwiki/www/w/includes/Wiki.php(63): MediaWiki->handleSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest)) #8 /home/pwiki/www/w/index.php(114): MediaWiki->performRequestForTitle(Object(Title), NULL, Object(OutputPage), Object(User), Object(WebRequest)) #9 {main} Attached is the file that I am attempting to upload.
File is too large to attach, so I uploaded it there instead: http://upload.gaiatools.com/files/p2escape_1_0.dem
Related to bug 26367, presumably happens when the file is not recognized by MimeMagic. Assigning to Neil.
I tried adding the line: application/octet-stream dem to includes/MimeMagic.php, but it didn't change anything :(
Created attachment 8675 [details] Test case Test that should pass if this bug is fixed.
Fixed in r90340
Thanks! However, this does not fix the second half of the problem: Attempting to move already-uploaded .dem files, without changing the .dem extension, causes the error "The new file extension does not match its type" to appear (and the file doesn't move).
Reassigning to wikibugs-l per bug 37789
msn: Is moving already-uploaded .dem files still a problem in a recent MediaWiki version? If so, what are exact steps to reproduce?
This is still present in MediaWiki 1.20.3. Steps to reproduce: - Upload the .dem file linked above - Try to rename it to something else (keeping the .dem extension) Error obtained: "You do not have permission to move this page, for the following reason: The new file extension does not match its type" Perhaps interestingly, the file page - http://theportalwiki.com/wiki/File:Portal_2_-_Chapter_4_-_Chamber_21_%28Escape%29.dem - says "MIME type: application/vnd.ms-excel.sheet.binary.macroenabled.12" which is definitely inaccurate. I suspect that, when moving, it checks if the new filename's extension corresponds to the MIME type of the file, which MediaWiki incorrectly assigned to begin with.