Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94525 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63070 invoked from network); 17 Jul 2016 04:13:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2016 04:13:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=michael.vostrikov@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=michael.vostrikov@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.174 as permitted sender) X-PHP-List-Original-Sender: michael.vostrikov@gmail.com X-Host-Fingerprint: 209.85.220.174 mail-qk0-f174.google.com Received: from [209.85.220.174] ([209.85.220.174:32916] helo=mail-qk0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D2/73-31884-BC50B875 for ; Sun, 17 Jul 2016 00:13:01 -0400 Received: by mail-qk0-f174.google.com with SMTP id p74so133120361qka.0 for ; Sat, 16 Jul 2016 21:12:59 -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=WE8LPWL/Z0h94nG7LN/hTbW2xVic7GppMI9kfb3Peok=; b=xRWRl+TCyKTwKnB9wYMk5dNGkunjHaETBi7EcYUybKar1iUsrKxdMylHWxe9rlAOKH 34pxiypyNrPPUKcLLbu1M5V6otlYWwsrUmI3fmg/W/bmYhqc6p7I1usooiC1qmklRuQr KFbvYdCgC/hG9rkrbSJhetxgffxT4/6K4ZDzty0PTv4FsuKSLCTPOV5uv27liFFJEdQ/ JjS3LN3T/uyKYvyh8LCaqNFveWNC8sXc1rbxN4Q6JnN0q2NMbpWkmln0Pc8d1bfzyUwP Rg9GAq22bEoyFNyPI8FBONEy1yOwYweXI6fjXVUMz816Y2FBTFqSmQQFqFAGEMbRmN3U dBcw== 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=WE8LPWL/Z0h94nG7LN/hTbW2xVic7GppMI9kfb3Peok=; b=HYDG6f78ozuoC2/ycA9+PLovk2htQmddQi71gBtFLkROLgb2zD9lJ3dCtMGEiFDnft leqlvodKjSVQS/VcKarC98NvX4LeJfycoSTZHVJ4MHrXe47TZb3qJxjhnU2l5Uuv7TMm yvS47p57XIXPjrJtB8rJFqthuw+rJCz2ht5KdneDEuHYoxKesR136KgKbuaoNCp8kgH1 40UuvWPCbZ6V1gYKGRCA0MWE5HhcLLHok4jKu49FKh06N1NG+jVOT2hYyUkHiQFzoABY cMvYCwS5qPKfTNjc2MXLd2l2VGC2EzfRJh2tn2Od9zb45H4l96br8IMdd/nGQK/OY7Yy sHkA== X-Gm-Message-State: ALyK8tK/wMmxVzYe0GmPmLmIJchs/72zSQaqMo+b7d/xo8BYgkdlhgY6wJxvLLrdUqSJSLTqrSVksJ7Hi+Z3Hw== X-Received: by 10.55.74.138 with SMTP id x132mr35735675qka.26.1468728777401; Sat, 16 Jul 2016 21:12:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.189.135 with HTTP; Sat, 16 Jul 2016 21:12:56 -0700 (PDT) In-Reply-To: References: Date: Sun, 17 Jul 2016 09:12:56 +0500 Message-ID: To: Dan Ackroyd Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a114a82f80c6b5e0537cd11b4 Subject: Re: [PHP-DEV] [RFC] New operator for context-dependent escaping From: michael.vostrikov@gmail.com (Michael Vostrikov) --001a114a82f80c6b5e0537cd11b4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > > 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 ... > I would not call it 'hacking') This is exaclty the same as if we write 'PHPEscaper::escape()' manually in PHP context. I didn't want to add many related items to a global namespace, and with class it is possible to use autoloading. 2. Is there any rationale why we're using strings separated by '|' to pass > context instead of an array? Ex.: > > Yes, I thought about array. It can be added on a par with string. Strings just looks more similar to escaping in template engines. 3. I think the default implementation should throw a more specific > exception in case of unknown context (\PHP\EscapeException?) > 4. This line on your patch is unnecessary > You are right, thanks. This commit is a concept, if RFC will be accepted, I will prepare a patch with more correct code. =E2=80=8B --001a114a82f80c6b5e0537cd11b4--