Last modified: 2010-05-15 15:54:52 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 T16273, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 14273 - wfAcceptToPrefs doesn't support spaces in the Accept header string
wfAcceptToPrefs doesn't support spaces in the Accept header string
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.12.x
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-26 13:27 UTC by Mark Jaroski
Modified: 2010-05-15 15:54 UTC (History)
2 users (show)

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


Attachments
one line patch to add trim() (393 bytes, patch)
2008-05-26 13:29 UTC, Mark Jaroski
Details

Description Mark Jaroski 2008-05-26 13:27:36 UTC
If the Accept header passed to wfAcceptToPrefs() contains spaces the resulting list of mime types will have spaces at the beginning of each type.  They should be trimmed.
Comment 1 Mark Jaroski 2008-05-26 13:28:22 UTC
I was given SVN commit access a while ago, but have never done anything with it.  I'm happy to commit this tiny change if folks think it's worth while.

-mark
Comment 2 Mark Jaroski 2008-05-26 13:28:55 UTC
adding self to the cc list
Comment 3 Mark Jaroski 2008-05-26 13:29:38 UTC
Created attachment 4926 [details]
one line patch to add trim()
Comment 4 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-05-28 13:23:01 UTC
Tabs, not spaces.  :)  Can't comment on the patch itself, I don't know why/whether these need to be trimmed.
Comment 5 Mark Jaroski 2008-05-28 13:38:29 UTC
Well, the reason why the extra whitespace would need to be trimmed is that as it is the array output by wfAcceptToPrefs() won't work as the input to wfNegotiateType(), specifically with the Accepts header sent by Konqueror.  The array looks something like this (pseudo code):

array(
 "text/html" => 1,
 " text/plain" => 1,
 " image/*" => 1
);

note the extra spaces.  If wfNegotiateType() tries to match this with a list of mime types from somewhere else it won't work, because the extra spaces mean that the first part of the mime type doesn't match.
Comment 6 Brion Vibber 2008-05-28 19:17:41 UTC
Fixed in r35509.

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


Navigation
Links