php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72118 Not respecting accept language header
Submitted: 2016-04-28 10:18 UTC Modified: 2016-09-04 04:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: php at alper dot nl Assigned: cmb (profile)
Status: No Feedback Package: Website problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2016-04-28 10:18 UTC] php at alper dot nl
Description:
------------
I regularly come to php.net for documentation. More often than not I get the German language version of the pages.

This is incorrect because:

- In my preferences English is the first language for webpage content.

- I change the language to English but the next time I receive German documentation again.

This is a significant usability error and it is weird that something as fundamental as the Accept-Language header could be broken here.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-24 09:15 UTC] james dot antrim at nm dot thm dot de
This is actually two issues mirrored by the author's two bullet points.

The first is the more important and would, for most users, preempt the second issue. My Accept-Language header looks like this.

Accept-Language:en-US,en;q=0.8,de-DE;q=0.6,de;q=0.4

Yes, I can read German. No, I would rather not. Please just automatically give me the request language with the highest ranking.

The second issue, which would almost be superfluous if you would fix the first, is the extremely short lifespan of your last_lang cookie, only a day. This lifespan only helps those that are actively developing on or for the site, since most users only use the site as the reference work it is intended to be and are much more infrequently here.
 [2016-08-26 18:29 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2016-08-26 18:29 UTC] cmb@php.net
> Please just automatically give me the request language with the
> highest ranking.

That is what happens on your first visit. Just delete the php.net
cookies and go to <http://php.net/manual/function.fgets.php>, for
instance. You will immediately be redirected to
<http://php.net/manual/en/function.fgets.php> and this page sets
the LAST_LANG cookie.

Of course, if you request
<http://php.net/manual/de/function.fgets.php>, you get the German
page, because you have explicitly requested that.

Note that there is also <http://php.net/my.php>, where you can
explicitly override the Accept-Language detection.

> […] is the extremely short lifespan of your last_lang cookie,
> only a day.

Well, for me it has an experation date one _year_ in the future.
Please post the relevant Set-Cookie header field value that you
receive.
 [2016-09-04 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC