Last modified: 2011-07-18 18:06:51 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 T31874, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29874 - Image extension strict whitelist handling is inconsistent
Image extension strict whitelist handling is inconsistent
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.20.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-reviewed
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-13 19:43 UTC by Dan Collins
Modified: 2011-07-18 18:06 UTC (History)
2 users (show)

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


Attachments
Patch that brings UploadBase.php in line with StreamFile.php (683 bytes, patch)
2011-07-13 19:43 UTC, Dan Collins
Details

Description Dan Collins 2011-07-13 19:43:29 UTC
Created attachment 8780 [details]
Patch that brings UploadBase.php in line with StreamFile.php

Greetings. While reviewing another bug report, I noticed the following:

On upload, UploadBase's getTitle is called, which validated image file extensions. It checks all of a file's extensions against the blacklist, but only the last extension against the whitelist (iff $wgCheckFileExtensions && $wgStrictFileExtensions, of course). However, StreamFile.php wfGetType checks all of a file's extensions against both lists. This is certainly wrong. Brion said on bug 11142 "Multiple extensions are checked on upload because the web server also checks multiple extensions when it's determining the type of a file to serve out", and so if we want to have StrictFileExtensions actually have any effect, it should really impose its will on every extension, not just one. The attached patch does just that, bringing UploadBase.php in line with StreamFile.php. Of course, the opposite change is also acceptable.
Comment 1 Mark A. Hershberger 2011-07-18 18:06:28 UTC
Applied in r92454

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


Navigation
Links