php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15313 Error in HTTP::negotiateLanguage (with solution)
Submitted: 2002-01-31 07:44 UTC Modified: 2002-01-31 08:41 UTC
From: tfranz at moleman dot de Assigned:
Status: Closed Package: PEAR related
PHP Version: 4.1.1 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tfranz at moleman dot de
New email:
PHP Version: OS:

 

 [2002-01-31 07:44 UTC] tfranz at moleman dot de
The part of the negotiateLanguage Function where the server's accepted languages are spitted into an arry uses only HTTP_ACCEPT_LANGUAGE which is not declared global (so there are no visible languages to explode)

Change the line from
$accepted = split(',[[:space:]]*', $HTTP_ACCEPT_LANGUAGE);

into

$accepted = split(',[[:space:]]*', $_SERVER['HTTP_ACCEPT_LANGUAGE']);

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-31 08:41 UTC] mj@php.net
Fixed in CVS.

Thanks for your report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 08:01:29 2024 UTC