Bug #80192 [Com]: session.use_trans_sid brokes JSON encoded HTML string

From: Date: Mon, 09 Nov 2020 12:27:49 +0000
Subject: Bug #80192 [Com]: session.use_trans_sid brokes JSON encoded HTML string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230221@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 Comment by: johnlilly055 at gmail dot com Reported by: thebetsuno at gmail dot com Summary: session.use_trans_sid brokes JSON encoded HTML string Status: Verified Type: Bug Package: Output Control Operating System: Any PHP Version: 7.3 Block user comment: N Private report: N New Comment: Wow! Helpful and fascinating article. Thanks for sharing such a great article with us. Keep sharing.https://www.thegenuineleather.com/category/cyber-monday-deals/ Previous Comments: ------------------------------------------------------------------------ [2020-10-07 08:21:45] cmb@php.net Confirmed: <https://3v4l.org/aRVKl>. ------------------------------------------------------------------------ [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

« previous php.bugs (#230221) next »