Page MenuHomePhabricator

MimeMagic aliases the empty string to all "main" mime types
Closed, ResolvedPublic

Description

Author: mike

Description:
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.


Version: unspecified
Severity: minor

Attached:

Details

Reference
bz10348

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:50 PM
bzimport set Reference to bz10348.
bzimport added a subscriber: Unknown Object (MLST).

*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*

sumanah wrote:

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.

sumanah wrote:

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

Krinkle edited subscribers, added: ori; removed: wikibugs-l-list.
Krinkle subscribed.

Presumed fixed now if I understand this correctly. Thanks @ori!

Krinkle assigned this task to ori.