Last modified: 2014-09-23 23:32:12 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 T12348, the corresponding Phabricator task for complete and up-to-date bug report information.
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)
unspecified
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review, performance
Depends on:
Blocks:
  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: ---


Attachments
patch to fix mime.info parsing regular expression (577 bytes, patch)
2007-06-23 23:23 UTC, Mike Baynton
Details

Description Mike Baynton 2007-06-23 23:23:34 UTC
Created attachment 3817 [details]
patch to fix mime.info 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 mime.info 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?

https://www.mediawiki.org/wiki/Developer_access

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


Navigation
Links