#22085 [NEW]: negotiateLanguage() in HTTP.php not case-insensitive
| From: | stanbery at miyazaki-catv dot ne dot jp | Date: | Thu, 06 Feb 2003 02:54:16 +0000 |
| Subject: | #22085 [NEW]: negotiateLanguage() in HTTP.php not case-insensitive | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-12995@lists.php.net to get a copy of this message | ||
From: stanbery@miyazaki-catv.ne.jp
Operating system: Linux 2.4.x
PHP version: 4.2.2
PHP Bug Type: PEAR related
Bug description: negotiateLanguage() in HTTP.php not case-insensitive
Problem with negotiateLanguage() in HTTP.php:
Using M$ 5.5, with "en-us" as my language (correct by RFC), and with "ja"
as my secondary language (q=0.5), I ran into a page detecting my broswer
as preferring Japanese. Looked at HTTP.php, checked cvs.php.net and
diff'd 1.15 (which I have) with 1.17 (latest in CVS), and the only _code_
delta was with the eregi() test. I upgraded HTTP.php, then retested --
with no luck. I then read the RFC --
RFC 2068 section 3.10 states:
...
Whitespace is not allowed within the tag and all tags are
case-insensitive.
...
So, somehow we need a case-insensitive key for $supported (not very
likely, I guess).
A solution would be to force all keys of $supported to lower case, then
force the $accepted array to also be lower case. Over all, not very
pretty. I'll see if I can come up with an easy fix -- but if someone
beats me to it, that's great. =)
--
Edit bug report at http://bugs.php.net/?id=22085&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22085&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=22085&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=22085&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22085&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=22085&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=22085&r=support
Expected behavior: http://bugs.php.net/fix.php?id=22085&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=22085&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=22085&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=22085&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22085&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=22085&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=22085&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=22085&r=gnused