Bug #80192 [Opn->Ver]: session.use_trans_sid brokes JSON encoded HTML string
| From: | cmb@php.net | Date: | Wed, 07 Oct 2020 08:21:46 +0000 |
| Subject: | Bug #80192 [Opn->Ver]: session.use_trans_sid brokes JSON encoded HTML string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-229435@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80192&edit=1
ID: 80192
Updated by: cmb@php.net
Reported by: thebetsuno at gmail dot com
Summary: session.use_trans_sid brokes JSON encoded HTML
string
-Status: Open
+Status: Verified
Type: Bug
-Package: Session related
+Package: Output Control
Operating System: Any
-PHP Version: 7.2.34
+PHP Version: 7.3
Block user comment: N
Private report: N
New Comment:
Confirmed: <https://3v4l.org/aRVKl>.
Previous Comments:
------------------------------------------------------------------------
[2020-10-07 04:21:39] thebetsuno at gmail dot com
Description:
------------
Enabled config parameter "session.use_trans_sid" breaks a JSON encoded HTML string.
Bug is reproducible in versions 5.6.40, 7.2.33 and I believe in other versions.
Test script:
---------------
<?php
ini_set("session.use_cookies", 0);
ini_set("session.use_only_cookies", 0);
ini_set("session.use_trans_sid", 1);
header('Content-Type: application/json');
echo json_encode('<a href="/test">test</a>');
Expected result:
----------------
"<a href=\"\/test?PHPSESSID=7siuuuk98ns2lps0v1v251f1k3\">test<\/a>"
Actual result:
--------------
"<a href=\?PHPSESSID=7siuuuk98ns2lps0v1v251f1k3"\/test\">test<\/a>"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80192&edit=1