Bug in HTTP.php
| From: | Christian Rishøj | Date: | Tue, 30 Jan 2001 19:01:31 +0000 |
| Subject: | Bug in HTTP.php | ||
| Groups: | php.pear | ||
| Request: | Send a blank email to php-pear+get-1216@lists.php.net to get a copy of this message | ||
Hi, I was just using the negotiateLanguage() function from HTTP.php and
noticed that on line 102:
/* Check for a valid language code in the top-level domain of
* the client's host address.
*/
if (eregi("\.[^\.]+$", $REMOTE_HOST, &$arr)) {
... $REMOTE host is used without being included in the local scope using
'global'.
Also, I think it would be nicer to use isset() in line 85 around
$supported[$l]:
if ($supported[$l] && $q > 0.0) {
...just in case people have a loud error_reporting().
I once applied for a CVS account but never got one - that why I spam you
guys with this instead of fixing it myself.
Besides, negotiateLanguage() doesn't seem to recognize the
accept-language header set by my browser (netscape 4.75 or so) - it
always returns the default language. I haven't been looking into the
problem yet, but I would like to hear if any of you have used this
function with success?
(I am probably just missing something...)
/Christian