Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94523 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58700 invoked from network); 17 Jul 2016 03:49:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2016 03:49:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=marcio.web2@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=marcio.web2@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.173 as permitted sender) X-PHP-List-Original-Sender: marcio.web2@gmail.com X-Host-Fingerprint: 209.85.161.173 mail-yw0-f173.google.com Received: from [209.85.161.173] ([209.85.161.173:35022] helo=mail-yw0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 32/C2-31884-1500B875 for ; Sat, 16 Jul 2016 23:49:38 -0400 Received: by mail-yw0-f173.google.com with SMTP id l125so134597986ywb.2 for ; Sat, 16 Jul 2016 20:49:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=m5K/xH4v3ifcGjZjEDyXPh9ucTgl9X56WTD6v/DWzJw=; b=P30G4iNw3YvRJaC1y015qEHKw4/XP/pTmkAuO12p1a5NrRFWTA3g+BtBYS84Uqz6Cw uxwsgQtTf29OUmtg7OaTQ2LBd6s2BzaOoNLOvRvuFceyLEl8tsKLg5Q4OYXKCzuT/YAn bIHKA/L4vKdHNoPmOu4bTvUj279Zdxg3PXWeOgGUkmab+wSf8OXkZ6NT3I6dMHqkIxWx qj5fBWML9+Jqfsuv3VKBVkw0uPusM4ClC93mEuNsGvAHyYq8fjf5Xi0qLXrNRnBDZSTw y+45dU6kBB17LdlRurnBt9vfJPzxeuDeckvRgtlgfWY+7c4h87OTzJh48P/VSHpI9hbE /dTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=m5K/xH4v3ifcGjZjEDyXPh9ucTgl9X56WTD6v/DWzJw=; b=fJIAsTK+FGjdfJXcV54HUG5jZt8A7BhwWBSe4fOcihmt9qvJWuq+2N+8Z1LOwmzgEa ORDRPoZ7GlnDdBWAMJQvGeKTFXJbRfqQx9P3qB9qb+bM6qQIAlc7W1pvO1X9+Or7rbws /jhaFvA3pAxCn/HYH5AoFG7BzTQeyUlFwZHVkb3q/VAK33/KRN223GD6wC6OOYSKuast OOA0e8mYQFUKx37poMqtWtVXxdkfinMEb68XpCHt/rwCpN/NrkeQ6t8bgpEJzvsMkiJy BT7qDN519zQxvOVsqmdLkeFabjsnR3Njs45hx6aL9i9wtwHbllnQuUocAxVqt2jPoTCq 1KIA== X-Gm-Message-State: ALyK8tI3jR7EiSUl/GyJJmQrjiHicpCt2/+TbGo4vF5lTpqRXzRBtoVNHg/lhEw/BNmaAUMfrwNd6KzaGbiJyA== X-Received: by 10.129.178.72 with SMTP id q69mr18770416ywh.77.1468727375187; Sat, 16 Jul 2016 20:49:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.63.5 with HTTP; Sat, 16 Jul 2016 20:49:15 -0700 (PDT) In-Reply-To: References: Date: Sat, 16 Jul 2016 23:49:15 -0400 Message-ID: To: Michael Vostrikov Cc: PHP Internals Content-Type: multipart/alternative; boundary=94eb2c1464b47856050537ccbdda Subject: Re: [PHP-DEV] [RFC] New operator for context-dependent escaping From: marcio.web2@gmail.com (Marcio Almada) --94eb2c1464b47856050537ccbdda Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2016-07-16 11:33 GMT-04:00 Michael Vostrikov : > > Hello. > I have created RFC about context-dependent escaping operator. > https://wiki.php.net/rfc/escaping_operator > > Initial discussion was here: http://marc.info/?t=3D146619199100001 Hi, A few possible RFC improvements: 1. Is there any specific reason why we're using a class instead of functions to register a callable the same way it's done for exception handling or error handling? Hacking non FQN resolutions to inject another escaper implementation as in "" was a creative idea but it seems inconsistent with the preferable "PHP way" to handle these edge cases. 2 . Is there any rationale why we're using strings separated by '|' to pass context instead of an array? Ex.: 3. I think the default implementation should throw a more specific exception in case of unknown context (\PHP\EscapeException?) - currently it's throwing \Exception. The reason for that is because log level and handling may be more severe in case of failing escaping. Userland implementations should be encouraged to throw the same specific exception too (documentation could enforce that). 4. This line on your patch is unnecessary: https://github.com/michael-vostrikov/php-src/commit/571cd7c88488a08c82b10f0= c3af559881f1a2951#diff-7eff82c2c5b45db512a9dc49fb990bb8R274 In general this RFC looks better than the expected considering the previous discussions. Please, keep improving :) Best, M=C3=A1rcio. --94eb2c1464b47856050537ccbdda--