[PHP-DEV] PHP 4.0 Bug #6378 Updated: browscap configuration cause PHP to crash From: Bug Database (php-dev <email protected>)
Date: 08/31/00

ID: 6378
User Update by: stud1174 <email protected>
Old-Status: Feedback
Status: Open
Bug Type: Reproduceable crash
Description: browscap configuration cause PHP to crash

OK, I installed PHP 4.0.2 and the problem is fixed. However when I used browscap.ini version 2.5 (feb 2000), the following message box appeared when php.exe started:
  Error parsing browscap.ini on line 6300

This is the latest browscap.ini file downloaded from http://www.cyscape.com/browscap/

However the get_browser() function worked fine despite the message box. When I used the browscap.ini that comes with IIS4 (a very old file) everything worked fine!

Finally 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 clever in this case and use getenv() to get the HTTP_USER_AGENT!

Full Bug description available at: http://bugs.php.net/?id=6378

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>