Re: Proposed feature for json_encode()

From: Date: Tue, 04 Dec 2007 02:28:54 +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-33620@lists.php.net to get a copy of this message
Alan Knowles wrote: > One thing to consider is changing json_encode to add a header > Content-type: application/json (or x-javascript), unless the additional > arguments are used.. > That way someone using the function to intermingle with HTML will be > faced with the fact they have to encode the output, otherwise it breaks > the page... Now that sounds downright disruptive, and all the tutorials will say: Use json_encode('foobar', NO_HEADERS) because the other way does weird stuff to PHP scripts. :-) -- Edward Z. Yang GnuPG: 0x869C48DA HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]

« previous php.internals (#33620) next »