|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57807 http_negotiate_* does not return default value on non-match
Submitted: 2007-08-29 09:42 UTC Modified: 2007-08-29 12:24 UTC
From: boen dot robot at gmail dot com Assigned: mike (profile)
Status: Closed Package: pecl_http (PECL)
PHP Version: 5_2 CVS-2007-08-29 OS: Windows XP SP2
Private report: No CVE-ID: None
 [2007-08-29 09:42 UTC] boen dot robot at gmail dot com
http_negotiate_language() doesn't return the default language when there are no matching languages. Oddly enough, when there is no Accept-Language header, the default language is returned, as it should. It's just that when there IS such, but it doesn't contain any matches (even partial ones), no value is returned.

Please note that the actual version I'm using is 5.2.4RC2. The whole HTTP extension doesn't seem to be loading properly in RC3 (or at least in yesterday's snapshot I tried).

Reproduce code:
$lang = http_negotiate_language(array('bg','en'),$results);
echo $lang;

Expected result:
Accept-Language: fr
header, the output should have been the same as if no header was present which from the above sample means:

    [bg] => 1
    [en] => 1

Actual result:
Accept-Language: fr
header, the output is:



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-29 12:24 UTC]
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 15:01:32 2024 UTC