You not report the quality factor of these languages.bongobongo wrote: Before the script gets to the usort($browser_langs, ...) then it contains:
no
en
which is the priority of the languages as set in my browser.
After the usort it contains
en
no
Which now does not honor my priority given to no as set in my browser.
Since I have set priority to "no" (norwegian) in my browser then I would like the site to show up in Norwegian pages.
Accept-languages has language AND quality factor, from RFC2616:
if missing then q has default value of 1Each media-range MAY be followed by one or more accept-params, beginning with the "q" parameter for indicating a relative quality factor. The first "q" parameter (if any) separates the media-range parameter(s) from the accept-params. Quality factors allow the user or user agent to indicate the relative degree of preference for that media-range, using the qvalue scale from 0 to 1 (section 3.9). The default value is q=1
Browser can display languages in ANY order BUT must following the right quality factorbongobongo wrote: What is the meaning of the usort line.... what is it ment to do? I belive it should never have been there.
usort do that .... the right order
However my results:
FF 3.0.4:
Before:
it-it-1
it-0.8
en-us-0.5
en-0.3
After
it-it-1
it-0.8
en-us-0.5
en-0.3
IE6 (with no, en-us and it):
Before:
no-1
es-us-0.7
it-0.3
After:
no-1
es-us-0.7
it-0.3
Repeat, for me it's not a bug (as also evidenced from the site www.php.net)bongobongo wrote: That said, the usort line might not result in a bug for everyone, since it depends on what languages are defined
in the browser and the natural sort order of those languages (as is in the browser_langs array after usage of the usort) compared to the priority you have given to each language.
If I will have further report users then I investigate further but now I stop here
EDIT:
I read this that IE7 Accept-Language header is calculated based ALSO on the Windows default locale
Best regards
Alby