php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36045 Nested quotes are ignored by parse_ini_file
Submitted: 2006-01-17 10:26 UTC Modified: 2021-09-27 13:58 UTC
Votes:6
Avg. Score:4.5 ± 0.8
Reproduced:5 of 5 (100.0%)
Same Version:4 (80.0%)
Same OS:1 (20.0%)
From: php at koterov dot ru Assigned: cmb (profile)
Status: Not a bug Package: Filesystem function related
PHP Version: 5.1.2 OS: Windows XP
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at koterov dot ru
New email:
PHP Version: OS:

 

 [2006-01-17 10:26 UTC] php at koterov dot ru
Description:
------------
While using parse_ini_file there is no possibility to insert double-quote in the value. Seems function completely removes nested quotes and da data between them.

Standard for INI file "quote quoting" method is doubling (see MS Excell, Thunderbird, Outlook, GMail programs which could create INI files). But it does not work with parse_ini_file.

Reproduce code:
---------------
--file.ini--
key  = "test""quotes"

--test.php--
print_r(parse_ini_file('file.ini'));

Expected result:
----------------
test"quotes

Actual result:
--------------
testquotes

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-09 00:06 UTC] ajf@php.net
-Package: Feature/Change Request +Package: Filesystem function related
 [2021-09-27 13:58 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Type: Feature/Change Request +Type: Bug -Assigned To: +Assigned To: cmb
 [2021-09-27 13:58 UTC] cmb@php.net
You need to escape with a backslash[1].  While this might be
uncommon for INI files, it is a long standing and well
documented[2] behavior, so it's not going to change.

[1] <https://3v4l.org/fqZ0F>
[2] <https://www.php.net/manual/en/function.parse-ini-file.php#refsect1-function.parse-ini-file-examples>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 16:01:28 2024 UTC