#19902 [Bgs->Ana]: browscap.ini parsing error

From: Date: Tue, 15 Oct 2002 00:44:04 +0000
Subject: #19902 [Bgs->Ana]: browscap.ini parsing error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-22446@lists.php.net to get a copy of this message
 ID:               19902
 Updated by:       iliaa@php.net
 Reported By:      juri@ria.com
-Status:           Bogus
+Status:           Analyzed
 Bug Type:         Scripting Engine problem
 Operating System: All Win
 PHP Version:      4.2.3
 New Comment:

Actually after checking it seems the Windows distribution contains a
bundled browscap.ini file. My applogies. I'll look into why we are
bundling this file and what can be done to correct it.


Previous Comments:
------------------------------------------------------------------------

[2002-10-14 19:35:26] iliaa@php.net

browscap.ini is NOT released by PHP, this file can be obtained from
various sources on the net none of which are related to the PHP
project. PHP merely has a generic ini parser that amongst other things
can parse browscap.ini files. For whatever reason those files are not
always completely compatible or properly formatted. Thus they sometimes
cannot be parsed completely by the PHP's parser. This means that the
incompatible lines should either be removed or altered.

------------------------------------------------------------------------

[2002-10-14 19:24:52] juri@ria.com

Hello Iliaa

Why do you release a browscap.ini with invalid entries with every new
distribution of PHP?

Everybody using browscap.ini is forced to edit it, before he may use
it. Cumbersom...

Kind regards
Juri

------------------------------------------------------------------------

[2002-10-14 18:54:22] iliaa@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php

The browscap.ini sometimes contains not valid entries not supported by
PHP's ini parser. Simply remove those lines, there are usually very few
of those.

------------------------------------------------------------------------

[2002-10-14 10:38:13] juri@ria.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

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=19902&edit=1



Thread (8 messages)

« previous php.bugs (#22446) next »