php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19902 browscap.ini parsing error
Submitted: 2002-10-14 10:38 UTC Modified: 2002-10-28 10:03 UTC
From: juri at ria dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.2.3 OS: All Win
Private report: No CVE-ID: None
 [2002-10-14 10:38 UTC] juri at ria dot com
Hello Bug Report reader.

<?php
 function list_array ($array) {
     while (list ($key, $value) = each ($array)) {
     $str .= "<b>$key:</b> $value<br>\n";
     }
     return $str;
 }
 echo "$HTTP_USER_AGENT<hr>\n";
 $browser = get_browser();
 echo list_array ((array) $browser);
?>

The browser information will be output together with the following message appended:
PHP: Error parsing [drive]:\[path]\browscap.ini on line 8206 

browscap.ini at line position 8206 reads:
browser=AE/2.1(Linux)

Changing "AE/2.1(Linux)" to "AE/2.1 Linux" solves the parsing error.
The parsing procedure seems to "dislike" brackets [(,)].

This problem is quite old, but still persists with PHP 4.2.3.

Suggestion: Update browscap.ini for PHP distributions accordingly.

Kind regards
Juri

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-28 10:03 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

The broken browscap.ini is no longer being bundled with Windows distributions of PHP. The documentation now links to a web site where a working browscap.ini, which is frequently updated can be obtained.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 01:01:30 2024 UTC