Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60950 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77405 invoked from network); 23 Jun 2012 22:25:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jun 2012 22:25:01 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@googlemail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:38006] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/D0-04949-B3246EF4 for ; Sat, 23 Jun 2012 18:25:00 -0400 Received: by lbgc1 with SMTP id c1so5712828lbg.29 for ; Sat, 23 Jun 2012 15:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mAM0crGXjpgr2kqt8qMOL3N3vzIvvgD9Gk7L5Oc96ic=; b=IUnbkH2VZGOZcunCeR2TNChayxvMYSqaVAhaFXW/v9/tOFDmklvozWpAY4oay/IzqF U6cL0VHjQnuUlRjN+vMAgT1vwxIJ0L17GBj7kxr84NEhV6zXiJ+LYta8TThcZ535zHgO S2YO84Qzc0Ku+OHDIhs8BPEDkEOWQ7RpmCQiyiaYAa8MRetMgJw/UwcAghfJBMou088D BHVaLom85plcaA7mZVtdMbuFs3wEtrhTIITfnGhF8hhYWP6lSbABmEr1LXtZ1JeFQQ6w y6yr9cwMANy+mtVryJYntSmKHeCWL4yWK6cYnNDUThDKIhLaFrzv7YvukU3i8Q+bjK2f htuA== MIME-Version: 1.0 Received: by 10.152.148.170 with SMTP id tt10mr6708811lab.48.1340490296612; Sat, 23 Jun 2012 15:24:56 -0700 (PDT) Received: by 10.152.114.70 with HTTP; Sat, 23 Jun 2012 15:24:56 -0700 (PDT) In-Reply-To: <4FE61E9D.5050908@sugarcrm.com> References: <20120621141241.GA25789@analysisandsolutions.com> <4FE33EDF.2000409@lerdorf.com> <4FE61E9D.5050908@sugarcrm.com> Date: Sun, 24 Jun 2012 00:24:56 +0200 Message-ID: To: Stas Malyshev Cc: Rasmus Lerdorf , Daniel Convissor , PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] json_encode() behavior for incorrectly encoded strings From: nikita.ppv@googlemail.com (Nikita Popov) On Sat, Jun 23, 2012 at 9:53 PM, Stas Malyshev wrote: > Hi! > >> The warning for invalid UTF-8 stays intact and is thrown also with >> display_errors = On. If this behavior is undesired this can be remedied >> later. > > Must we discuss it 1000 times anew? There was a reason why it didn't > throw warning when display_errors is on. The reason is that it is very > easy to feed the server configured with display_errors = on wrong JSON > and thus force it to reveal information, and this is largely beyond the > control of application writer. Yes, I feel like we must discuss this a thousand times anew. There clearly is no consensus about it. Just look at the responses in this thread and in other discussions relating this issue. When people read "throws a warning, but only if display_errors=Off" they automatically replace the Off with an On in their mind. The behavior is simply that unintuitive. Also I'd like to point out that we already decided to *not* use this behavior in other, similar situations. E.g. max_input_vars throws regardless of display_errors (and yes, this was discussed when the feature was introduced). In any case, I don't care *that* much about how json_encode behaves, so I'd be fine with either way. Would just be nice if someone could tell me what that "way" should be. I didn't see any consensus in the discussion. > But what I am worried about even more is getting back to that "commit > first, discuss later" mentality. Why we have again a commit in the > stable branch before we have a consensus decision what it should be doing? I only wanted to sync the branches up. I didn't consider the warning such an important aspect of this issue and thought that it would be okay to simply adjust it in a separate commit. Nikita