[FIX] lex pattern for ini-file sections wrong (affects php.ini/parse_ini_file())
| Bug #28804 | [FIX] lex pattern for ini-file sections wrong (affects php.ini/parse_ini_file()) | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2004-06-16 14:20 UTC | Modified: | 2005-02-03 04:02 UTC |
|
||||||||||
| From: | wendland at scan-plus dot de | Assigned: | zeev (profile) | |||||||||||
| Status: | Closed | Package: | Scripting Engine problem | |||||||||||
| PHP Version: | 4CVS, 5CVS | OS: | ||||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2004-06-16 14:20 UTC] wendland at scan-plus dot de
Description:
------------
The pattern for section in ini-files (as used in php.ini and each file used with parse_ini_file()) is wrong. It looks like (in Zend/zend_ini_scanner.l:140):
<INITIAL>[[][^[]+[\]][ ]*{NEWLINE}?
That means that the following example won't work:
[section]
var = "val"
var2 = "]"
var3 = "val3"
Try to run this through parse_ini_file(). The pattern should look like:
<INITIAL>\[[^\]]+\][ ]*{NEWLINE}?
If you'd like to disallow brackets in section name, you could use the following pattern:
<INITIAL>\[[^\]\[]+\][ ]*{NEWLINE}?
Kind Regards,
Joerg Wendland
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2004-12-13 01:33 UTC] sniper@php.net
[2005-02-03 04:02 UTC] sniper@php.net