Edit report at http://bugs.php.net/bug.php?id=52161&edit=1
ID: 52161 Updated by: johan...@php.net Reported by: niazuddin dot ahmed at gmail dot com Summary: json_encode encoding HTML tags within strings incorrectly -Status: Open +Status: Feedback Type: Bug Package: JSON related Operating System: RedHat PHP Version: 5.3.2 New Comment: Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ can't reproduce Previous Comments: ------------------------------------------------------------------------ [2010-06-23 18:22:33] niazuddin dot ahmed at gmail dot com Description: ------------ When using json_encode for strings with HTML tag, end tag gets HTML encoded but the start tag is left alone Test script: --------------- echo json_encode(array('test' => '<b>Bold</b>')); Expected result: ---------------- {"test":"<b>Bold</b>"} This is valid JSON as per http://www.jslint.com/ Actual result: -------------- {"test":"<b>Bold<\/b>"} ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52161&edit=1