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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

History

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

Thanks for your report.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 01 05:01:29 2025 UTC