Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68947 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38162 invoked from network); 7 Sep 2013 16:36:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2013 16:36:51 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.52 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.219.52 mail-oa0-f52.google.com Received: from [209.85.219.52] ([209.85.219.52:36622] helo=mail-oa0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0D/9B-00660-2265B225 for ; Sat, 07 Sep 2013 12:36:51 -0400 Received: by mail-oa0-f52.google.com with SMTP id f4so5084652oah.39 for ; Sat, 07 Sep 2013 09:36:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=eoGSeq4bg43s21dTPW7U5gPbPbtjDRL3fTiNe0LXgJA=; b=D2J8yDgfYRV5koBmySWwM6wW3MRAN70fXh5UQeqyLuQnwUr1akqLWpikTMnDHMyHIP 1D4LdxWFr2O1A2uNOYgtqFhamVjfj+mIw7KEMinYFWy8ma0OWZYbHTtBoQeH3Txy9ei+ HP6qtoSI612Y0hKTI/NIFu2dFE14+rSD3RPiYHuuE+vhsPTRZzWX6C+q4fgmgoWvsKGG Lutg9HkvQUzgwjrDnPHGwQzhPdG7fAx6+hoHiPkR/CQQkrB/rkYZHglOKcUTlq0dVvnx K9HLHh+w11lrOGWtxHazrHQG5Z47lqmtYtW5am4rPoTWR56UcgAQrkc/+Ln3VIimWnGV XhJQ== MIME-Version: 1.0 X-Received: by 10.60.60.105 with SMTP id g9mr5958316oer.8.1378571807612; Sat, 07 Sep 2013 09:36:47 -0700 (PDT) Received: by 10.76.122.200 with HTTP; Sat, 7 Sep 2013 09:36:47 -0700 (PDT) In-Reply-To: <522B4F8D.2040107@mjburgess.co.uk> References: <522B4F8D.2040107@mjburgess.co.uk> Date: Sat, 7 Sep 2013 10:36:47 -0600 Message-ID: To: Michael John Burgess Cc: internals Content-Type: multipart/alternative; boundary=089e0149d0aee3e73a04e5cdc2b4 Subject: Re: [PHP-DEV] [RFC] Escaping RFC for PHP Core - Updates? From: morrison.levi@gmail.com (Levi Morrison) --089e0149d0aee3e73a04e5cdc2b4 Content-Type: text/plain; charset=ISO-8859-1 On Sat, Sep 7, 2013 at 10:08 AM, Michael John Burgess < michael@mjburgess.co.uk> wrote: > On 07/09/2013 15:41, Levi Morrison wrote: > >> It looks nicer than Escaper::escapeJs(), Escaper::escapeHtml(), etc. >>> >>> Any comments? >>> >> >> >> Please, don't go down this route. You do not want one class to escape all >> kinds of data; delegate each type of escaping to its own class: >> >> JavaScriptEscaper->escape(); >> PhpEscaper->escape(); >> HtmlEscaper->escape(); >> HtmlAttributeEscaper->escape()**; >> >> I should not have to defend this but I am willing to explain in more >> detail >> if someone would like me to. >> >> > > There doesnt need to be any object-oriented version for this problem. It's > a series of pure functions. Wraping them in one or more classes adds > nothing. If you are making a class then do it properly; if you aren't using a class then use sensible functions. Using a poorly designed class as originally proposed is not helping anything and may hurt as well. --089e0149d0aee3e73a04e5cdc2b4--