php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #6513 get_browser() and register_globals
Submitted: 2000-09-03 09:20 UTC Modified: 2002-12-30 10:10 UTC
From: stud1174 at di dot uoa dot gr Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.0 OS: all
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: stud1174 at di dot uoa dot gr
New email:
PHP Version: OS:

 

 [2000-09-03 09:20 UTC] stud1174 at di dot uoa dot gr
I have a remark about the get_browser() function. When this function is called without arguments it is supposed to use $HTTP_USER_AGENT for argument. However if I use the
configuration directive
   register_globals = Off
then the variable $HTTP_USER_AGENT is not defined and get_browser() returns an error. In this case I have to do the following
   $HTTP_USER_AGENT = getenv("HTTP_USER_AGENT");
   $browser = get_browser();
or alternatively
   $a = getenv("HTTP_USER_AGENT");
   $browser = get_browser($a);

I suggest that get_browser() function should act more cleverly in this case and use getenv() to get the HTTP_USER_AGENT.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-04 10:31 UTC] philip@php.net
This is a doc problem, not a feature request.  Not sure when this behavior changed but I just tested and register_globals does not affect get_browser() in PHP 4.3.0 but a user comment suggests this problem existed as of 10-Jan-2002 so it needs to be researched.

a) When was this fixed?  Document what it means.
b) Remove the $, and refer to $_SERVER in docs
c) If it turns out this wasn't fixed, reopen as a bug
 [2002-12-29 23:07 UTC] philip@php.net
I'm leaving this open until someone can test with an older version, I don't feel like it right now :)  But, the docs are now register_globals = off friendly.
 [2002-12-30 10:10 UTC] philip@php.net
This is now documented, this problem exists prior to 4.0.6 and the diff to php4 source can be seen here:

http://cvs.php.net/diff.php/php4/ext/standard/browscap.c?r1=1.42&r2=1.43

Doc changes can be seen here:

http://cvs.php.net/cvs.php/phpdoc/en/reference/misc/functions/get-browser.xml

Thank you for the report and making PHP better :)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 07 10:01:34 2025 UTC