Edit report at http://bugs.php.net/bug.php?id=52161&edit=1

 ID:                 52161
 Updated by:         fel...@php.net
 Reported by:        niazuddin dot ahmed at gmail dot com
 Summary:            json_encode encoding HTML tags within strings
                     incorrectly
-Status:             Feedback
+Status:             Closed
 Type:               Bug
 Package:            JSON related
 Operating System:   RedHat
 PHP Version:        5.3.2
-Assigned To:        
+Assigned To:        felipe
 Block user comment: N

 New Comment:

I got the expected result. Closed.


Previous Comments:
------------------------------------------------------------------------
[2010-06-23 22:54:29] johan...@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

can't reproduce

------------------------------------------------------------------------
[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&lt;\/b&gt;"}


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52161&edit=1

Reply via email to