Chrome use in HTTP_ACCEPT_LANGUAGE upper case letters.
Cause oh this the regex failes to determine the priorety of these languages
attached patch fix this issue.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | d6-language-fix.patch | 757 bytes | flaviovs |
| browser_language_detection.patch | 682 bytes | greenrover33 |
Comments
Comment #2
flaviovs commentedThis issue affects mostly those whose default language tag are on the "xx-yy" form, such as "pt-BR" , "en-CA" etc. So I'm afraid that this is the cause this long lasting bug is still present.
Notice that Drupal is wrong in expecting only lowercase language tags as RFC 2616 Sec. 3.1 clearly states that "all [language] tags are case- insensitive".
This is a major issue as it breaks expected behavior. The bug is gaining exposition because some new browsers (e.g Chrome) send the country part in upper case, which makes the "Accept-Language" test fail, as pointed by Greenrover33.
Fortunately the fix is straightforward. Attached is a new simplified patch against 6.26. It just add the "i" (ignore case) flag to the test regexp.
Comment #3
damien tournoud commentedThere is more then that broken in this function. We should consider backporting #221712: locale_language_from_browser() doesn't parse language tags correctly, has a broken logic. Marking as duplicate.
Comment #4
flaviovs commentedDamien,
I understand that the language detection system need an overhaul, which was already done in D7. However, I'm afraid that such big change may not come do D6 in a near future.
In the meantime, expected behavior is broken, which is a major issue.
Perfection is the worst enemy of good solutions. The fix is just a straightforward 1-byte change, so I fail to understand why we cannot be more pragmatic here, apply the fscking patch, and close this long standing issue?
Comment #5
flaviovs commentedFixing unintentional status change from last post. Reopening as I think is more appropriate. Feel free to duplicate-close it if you think that the questions raised in my last post shouldn't be considered.
Sorry for the confusion.