Last modified: 2010-05-15 15:54:52 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 14273 - wfAcceptToPrefs doesn't support spaces in the Accept header string
wfAcceptToPrefs doesn't support spaces in the Accept header string
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  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: ---

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

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.

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):

 "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.