Bug #15423: HTTP::negotiateLanguage() severely bugged.

From: Date: Thu, 07 Feb 2002 10:36:43 +0000
Subject: Bug #15423: HTTP::negotiateLanguage() severely bugged.
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-4461@lists.php.net to get a copy of this message
From: vigna@acm.org Operating system: Linux Red Hat 7.2 PHP version: 4.1.1 PHP Bug Type: PEAR related Bug description: HTTP::negotiateLanguage() severely bugged. 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 bug report at http://bugs.php.net/?id=15423&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=15423&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=15423&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=15423&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=15423&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=15423&r=support Expected behavior: http://bugs.php.net/fix.php?id=15423&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=15423&r=notenoughinfo

« previous php.pear.dev (#4461) next »