php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21780 Reading ini file
Submitted: 2003-01-20 12:50 UTC Modified: 2003-01-20 14:26 UTC
From: ronstk at tiscali dot nl Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.3.0 OS: win98se/sambar5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ronstk at tiscali dot nl
New email:
PHP Version: OS:

 

 [2003-01-20 12:50 UTC] ronstk at tiscali dot nl
In the browscap.ini file is at line 8206 an litle problem
I found a error message during the install of v4.2.3 at that line.


[AE/2.1 (linux)]
;browser=AE/2.1(Linux)   <---- the / is not allowed!
browser="AE/2.1(Linux)"
version=2.1

it is the key/value because in section names there is no problem.
It cant be the dot because there are others without problem
The slash is in this case unique as value, no other have it.

Adding the double quotes repairs the this malfunction and
my system was running at top level.

Just take a look in v4.3.0 and there is no browscap.ini anymore.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-20 13:11 UTC] 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

As of PHP 4.3.0 we recommend that you use the browscap.ini provided by http://www.garykeith.com/browsers/downloads.asp.
That file is kept up to date and will work fine (in PHP context) without any modifications.
 [2003-01-20 14:26 UTC] ronstk at tiscali dot nl
Hallo, thanks for the quick response but Idon't agree for now.
When I start php.exe and the key/value pair has a slash in it, I get the error.
From the browsecap.ini included v4.2.3.

[AE/2.1 (linux)]
browser=AE/2.1(Linux)
;browser="AE/2.1(Linux)"
version=2.1

gives me the error in dosbox:
PHP:  Error parsing E:\Iservers\PHP\browscap\browscap.ini on line 8206.
When I move the semicolon 1 up so the quotes are involved php.exe don't give the error message anymmore.

Ok so I get the new browscap.ini and found slashes in the values, a lot more then the old file, and no error.
So what was wrong? wel pasting the bad section in the new file and I did get the error again. 
After deleting the '(' and ')' the error was disapeared.

My conclusion that the old file had a error wasn't wrong, but I had the wrong character as suspect.
It's also ok when I use quotes around the value.

Now I ask where is mentioned wich characters are not allowed in the value when writing or reading ini files?

Look at parse_ini_file?
found Note: If a value in the ini file contains any non-alphanumeric characters it needs to be enclosed in double-quotes ("). 
Wel php.ini does contains lot of values with non-alfa's 
and browscap also. 
As far I know are slashes and parenthesis non-alfa's.
Question stays why does in the above section [AE/2.1 (linux)] browser=AE/2.1 (linux) gives a error and not
platform=OS/2.

I just wanded to use ini files like windows is using to
set some configurations and that has give me the problems in the past.

May be not a real bug but it's also not a consistent behaviour of parsing/handling ini files.

You can close this topic if you want.
Thanks again Ron.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Nov 29 09:00:01 2025 UTC