Last modified: 2014-05-23 01:25:24 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T27226, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 25226 - Old revisions served with wrong content type
Old revisions served with wrong content type
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
unspecified
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
: testme
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-20 11:36 UTC by CBM
Modified: 2014-05-23 01:25 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description CBM 2010-09-20 11:36:16 UTC
The older file revisions of [[en:File:21st_World_Scout_Jamboree.svg]] are PNG images, the newest revision is an SVG. When I click on the older revisions, I get an XML parsing error in my browser. This made me suspect a bad content-type, which I confirmed (see below).

Apparently, the backend needs to check the file type explicitly for old revisions, not using the file extension or the stored type of the newest revision. Presumably the file type could be cached so that it is only checked once per image. 

Trimmed output: 
$ wget -S 'http://upload.wikimedia.org/wikipedia/en/archive/b/b9/20091220134945!21st_World_Scout_Jamboree.svg'
  HTTP/1.0 200 OK
  Server: Sun-Java-System-Web-Server/7.0
  Date: Mon, 20 Sep 2010 11:27:26 GMT
  Content-Type: image/svg+xml
  Last-Modified: Tue, 08 Dec 2009 22:22:29 GMT
Length: 71991 (70K) [image/svg+xml]

$ file 20091220134945\!21st_World_Scout_Jamboree.svg 20091220134945!21st_World_Scout_Jamboree.svg: PNG image, 300 x 300, 8-bit/color RGBA, non-interlaced
Comment 1 Bawolff (Brian Wolff) 2010-09-20 22:34:31 UTC
Other interesting questions:
*How did the image get uploaded in the first place. Don't we do checks on upload to stop this sort of thing?
*Why is the thumbnail of the old file http://upload.wikimedia.org/wikipedia/en/thumb/archive/b/b9/20091208222229!21st_World_Scout_Jamboree.svg/127px-21st_World_Scout_Jamboree.svg being served as application/x-wiki (?!)
Comment 2 Bryan Tong Minh 2010-09-21 08:36:51 UTC
We do (In reply to comment #1)
> Other interesting questions:
> *How did the image get uploaded in the first place. Don't we do checks on
> upload to stop this sort of thing?
We do now, but I think this has not always been the case.

That brings back an anecdote that I heart some time before: "we generally assume that information in the database is correct, except when it is not"
Comment 3 Bawolff (Brian Wolff) 2010-09-21 13:48:52 UTC
>We do now, but I think this has not always been the case.

I could understand if we didn't back in the dark ages, but these files were uploaded in 2009, surely we had the checks back then?
Comment 4 Bryan Tong Minh 2011-02-10 15:43:59 UTC
(In reply to comment #3)
> >We do now, but I think this has not always been the case.
> 
> I could understand if we didn't back in the dark ages, but these files were
> uploaded in 2009, surely we had the checks back then?

Good question, local testing properly detects those files as image/png and refuses to upload them with an .svg extension.
Comment 5 Bawolff (Brian Wolff) 2014-05-23 01:25:24 UTC
Well the original files were deleted (Presumably still available at Special:Undelete)... I don't really think there's much we can do here. Fact is there are old files of the wrong type, as long as no new files can be uploaded like that, I think that is ok. I'm going to close this as WONTFIX (please don't hesitate to revert that decision if you disagree)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links