|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-10-07 08:21 UTC] cmb@php.net
-Status: Open
+Status: Verified
-Package: Session related
+Package: Output Control
-PHP Version: 7.2.34
+PHP Version: 7.3
[2020-10-07 08:21 UTC] cmb@php.net
[2023-08-23 11:22 UTC] truongthaietc50 at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 15:00:01 2025 UTC |
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>"