Bug #81482 [NEW]: parse_ini_string behaves differently than on PHP 8.0-
| From: | dseguy at exakat dot io | Date: | Mon, 27 Sep 2021 17:27:51 +0000 |
| Subject: | Bug #81482 [NEW]: parse_ini_string behaves differently than on PHP 8.0- | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-236868@lists.php.net to get a copy of this message | ||
From: dseguy at exakat dot io
Operating system:
PHP version: 8.1.0RC2
Package: Filesystem function related
Bug Type: Bug
Bug description:parse_ini_string behaves differently than on PHP 8.0-
Description:
------------
Here is a simple string that yields an error on PHP 8.1 and nothing on
PHP 8.0.
https://3v4l.org/Jg3Wu
I think the INI code should actually yield an error (the 4th " is
actually not escaped) but it used to be processed without error in PHP
8.0 and older.
I could not find a mention of parse_ini_* update in the NEWS, so it
might be collateral.
I suggest a mention of update in the migration manual will be good.
Test script:
---------------
<?php
$ini = <<<'INI'
code="
\"\\" value=\\"\" . htmlspecialchars($Value) . \"\\" />\n\";
";
INI;
print_r(parse_ini_string($ini));
Expected result:
----------------
Array
(
[code] =>
"\" value=\"" . htmlspecialchars($Value) . "\" />\n";
)
Actual result:
--------------
code="
\"\\" value=\\"\" . htmlspecialchars($Value) . \"\\" />\n\";
";PHP Warning: syntax error, unexpected '=' in Unknown on line 2
--
Edit bug report at https://bugs.php.net/bug.php?id=81482&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81482&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81482&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81482&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81482&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81482&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81482&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81482&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81482&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81482&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81482&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81482&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81482&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81482&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81482&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81482&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81482&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81482&r=mysqlcfg