php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8419 get_browser() returns false
Submitted: 2000-12-26 02:35 UTC Modified: 2001-01-08 15:19 UTC
From: chris-php-bugs at improbable dot org Assigned:
Status: Closed Package: *Function Specific
PHP Version: 4.0.4 OS: Linux (Mandrake 7)
Private report: No CVE-ID: None
 [2000-12-26 02:35 UTC] chris-php-bugs at improbable dot org
$ua = get_browser();

print_r($ua);



There are no error messages that I've been able to find - nothing in the php error log or the apache log. I've tested with a number of user-agent values and it has returned false in every case. (It is checking $HTTP_USER_AGENT, though - unset($HTTP_USER_AGENT) will cause an error indicating that it couldn't find the variable)



I've verified that it is picking up the correct file and that the file is readable by the apache process (at least using the php file functions). 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-28 08:55 UTC] sniper@php.net
What does phpinfo() have in the Apache environment
section for HTTP_USER_AGENT ??
And is register_globals = on  in your php.ini?

--Jani
 [2000-12-28 13:11 UTC] chris-php-bugs at improbable dot org
register_globals is on.

$HTTP_USER_AGENT is set to a valid user 
agent for the browser used (tested with 
Lynx & Netscape) and was definitely being 
read by get_browser() - it returns an error 
if it isn't set.

Additionally, I called get_browser() with 
several other user agent strings as the 
optional parameter. The results were 
identical.
 [2000-12-28 20:08 UTC] sniper@php.net
And you have got the browscap.ini file ? And you have the browscap directive
in you php.ini file? Please check this page for more info:

http://www.php.net/manual/function.get-browser.php

--Jani
 [2000-12-28 21:55 UTC] chris-php-bugs at improbable dot org
As mentioned in the original report, 
browscap.ini exists and the browscap entry 
in php.ini is pointing to it. A simple test 
script (e.g. "echo 
count(file(ini_get('browscap')))") had no 
problems loading the file.
 [2001-01-08 13:55 UTC] stas@php.net
What is your browscar.ini file? Most probably PHP does not
find the match for you browser, so if you could post your
user agent string and your browscap.ini file (preferably as
publicly-available file somewhere on the web), it would help
a lot.
 [2001-01-08 15:19 UTC] stas@php.net
Please try current CVS, it has browscap behaviour fixed. If
it still fails, please repoen and provide your bworscap.ini
file (or where I can get the same one).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 09 20:01:28 2024 UTC