Skip to content

Commit bb54309

Browse files
authored
parse_ini_*(): Add warning that the functions are unsafe with untrusted inputs (#4946)
1 parent 4ca7cde commit bb54309

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

reference/filesystem/functions/parse-ini-file.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@
2222
<para>
2323
The structure of the ini file is the same as the &php.ini;'s.
2424
</para>
25+
<warning>
26+
<simpara>
27+
This function must not be used with untrusted inputs, unless
28+
<parameter>scanner_mode</parameter> is <constant>INI_SCANNER_RAW</constant>
29+
since the parsed output might contain the values of sensitive
30+
constants, such as constants holding a database password.
31+
</simpara>
32+
</warning>
2533
</refsect1>
2634

2735
<refsect1 role="parameters">

reference/filesystem/functions/parse-ini-string.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@
2121
<para>
2222
The structure of the ini string is the same as the &php.ini;'s.
2323
</para>
24+
<warning>
25+
<simpara>
26+
This function must not be used with untrusted inputs, unless
27+
<parameter>scanner_mode</parameter> is <constant>INI_SCANNER_RAW</constant>
28+
since the parsed output might contain the values of sensitive
29+
constants, such as constants holding a database password.
30+
</simpara>
31+
</warning>
2432
</refsect1>
2533

2634
<refsect1 role="parameters">

0 commit comments

Comments
 (0)