Author: mark
Description:
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.
Version: 1.12.x
Severity: minor
• bzimport | |
May 26 2008, 1:27 PM |
F4964: wfAcceptToPrefs.patch | |
Nov 21 2014, 10:13 PM |
Author: mark
Description:
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.
Version: 1.12.x
Severity: minor
mark wrote:
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
ayg wrote:
Tabs, not spaces. :) Can't comment on the patch itself, I don't know why/whether these need to be trimmed.
mark wrote:
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.