Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33620 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3452 invoked by uid 1010); 4 Dec 2007 02:28:57 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 3437 invoked from network); 4 Dec 2007 02:28:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Dec 2007 02:28:57 -0000 X-Host-Fingerprint: 24.228.86.142 ool-18e4568e.dyn.optonline.net Received: from [24.228.86.142] ([24.228.86.142:22030] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6E/B5-52978-76BB4574 for ; Mon, 03 Dec 2007 21:28:56 -0500 Message-ID: <6E.B5.52978.76BB4574@pb1.pair.com> To: internals@lists.php.net Date: Mon, 03 Dec 2007 21:28:54 -0500 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041206 Thunderbird/1.0 Mnenhy/0.6.0.104 MIME-Version: 1.0 References: <474F0EE7.8020201@php.net> <474F4E47.8050506@zend.com> <474F5E12.1050404@php.net> <474F5F75.3030808@zend.com> <475081DD.90404@php.net> <4750B3CA.20405@zend.com> <475101FF.5080103@lerdorf.com> <475482AF.3050800@zend.com> <47548638.9020709@lerdorf.com> <475487D0.7050207@zend.com> <47549512.1000505@akbkhome.com> In-Reply-To: <47549512.1000505@akbkhome.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Posted-By: 24.228.86.142 Subject: Re: [PHP-DEV] Proposed feature for json_encode() From: edwardzyang@thewritingpot.com ("Edward Z. Yang") 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 Anti-XSS Filter [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]