Re: Proposed feature for json_encode()

From: Date: Tue, 04 Dec 2007 18:04:48 +0000
Subject: Re: Proposed feature for json_encode()
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-33664@lists.php.net to get a copy of this message
I think I understand what the use-case is… If the browser doesn't know anything about <script> tag, it is supposed to interpret it's contents as html… In which case, html-tags which appear in javascript code will actually become active ones
This makes sense. Though wouldn't htmlspecialchars($json, ENT_NOQUOTES) solve it? But this use case makes sense, so I suppose if one uses json to output the data inside HTML (as opposed to sending out in response to AJAX request for example) one would want to use such option. Thanks for finding this one! -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#33664) next »