|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2007-08-29 12:24 UTC] mike@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Thu Oct 30 23:00:01 2025 UTC | 
Description: ------------ 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: --------------- <?php $lang = http_negotiate_language(array('bg','en'),$results); print_r($results); echo $lang; ?> Expected result: ---------------- With Accept-Language: fr header, the output should have been the same as if no header was present which from the above sample means: Array ( [bg] => 1 [en] => 1 ) bg Actual result: -------------- With Accept-Language: fr header, the output is: Array ( )