Bug #15423 Updated: HTTP::negotiateLanguage() severely bugged.
| From: | mj@php.net | Date: | Thu, 07 Feb 2002 11:18:43 +0000 |
| Subject: | Bug #15423 Updated: HTTP::negotiateLanguage() severely bugged. | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-4464@lists.php.net to get a copy of this message | ||
ID: 15423
Updated by: mj@php.net
Reported By: vigna@acm.org
-Status: Open
+Status: Assigned
Bug Type: PEAR related
Operating System: Linux Red Hat 7.2
PHP Version: 4.1.1
-Assigned To:
+Assigned To: mj
New Comment:
The first two problems have been fixed in CVS. I also think,
that we can easily change the problem with the language
code, but I would like to hear the opinion of the package
maintainers.
- Martin
Previous Comments:
------------------------------------------------------------------------
[2002-02-07 05:36:42] vigna@acm.org
The code for HTTP::negotiateLanguage() is severely bugged.
At line 76 of HTTP.php, $HTTP_ACCEPT_LANGUAGE is accessed without
having been declarated global. Thus negotiation always happens on the
empty string (a warning is generated).
At line 102 $HTTP_SERVER_VARS['REMOTE_HOST'] is accessed without
checking for existence of the key, causing a warning.
The example stated in the documentation above the function uses "_" to
separate language and country. The HTTP RFC uses "-". The regexp used
to parse the header has neither.
The default value ("en_US") suffers from the same problem--it does not
respect the RFC.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15423&edit=1