Last modified: 2014-09-23 23:32:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 10348 - MimeMagic aliases the empty string to all "main" mime types
MimeMagic aliases the empty string to all "main" mime types
Status: NEW
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review, performance
Depends on:
  Show dependency treegraph
Reported: 2007-06-23 23:23 UTC by Mike Baynton
Modified: 2014-09-23 23:32 UTC (History)
2 users (show)

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

patch to fix parsing regular expression (577 bytes, patch)
2007-06-23 23:23 UTC, Mike Baynton

Description Mike Baynton 2007-06-23 23:23:34 UTC
Created attachment 3817 [details]
patch to fix parsing regular expression

A regular expression that's slightly off in MimeMagic's constructor causes it to keep whitespace between the last mime-type and the [MEDIATYPE] when parsing each line of the file. Each line is later explode()d on whitespace, causing MimeInfo to think each line contains at least two mime-types, which signifies an alias should be written from mime type 2+, usually the empty string, to the first mime type in that line.

This turns out not to hurt anything functionally, but does waste some cycles needlessly overpopulating the $mMimeTypeAliases array.

A patch consisting of a fixed regular expression is attached.
Comment 1 p858snake 2011-04-30 00:10:13 UTC
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Comment 2 Sumana Harihareswara 2011-11-10 06:16:13 UTC
Mike, thanks for your patch, and my apologies that it's taken so very long to get back to you.  Your patch still applies cleanly to trunk, hurray!  :-)  I'm adding the "need-review" keyword to ask for code review, and other keywords/components as I infer is appropriate.  Thanks again.
Comment 3 Sumana Harihareswara 2012-05-25 02:30:20 UTC
Mike, thanks again for the patch and my apologies that it's taken so long for us to respond.  Are you interested in using developer access to directly suggest it into our Git source control system, which would get it reviewed and possibly incorporated faster?

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