Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63150 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63698 invoked from network); 19 Sep 2012 16:25:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Sep 2012 16:25:17 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 64.22.89.133 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 64.22.89.133 oxmail.registrar-servers.com Received: from [64.22.89.133] ([64.22.89.133:57935] helo=oxmail.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7D/C8-15057-CE1F9505 for ; Wed, 19 Sep 2012 12:25:17 -0400 Received: from [192.168.0.200] (5ad4bfa1.bb.sky.com [90.212.191.161]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id 6C0F0758024; Wed, 19 Sep 2012 12:25:13 -0400 (EDT) Message-ID: <5059F1B8.2020609@ajf.me> Date: Wed, 19 Sep 2012 17:24:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: Michael Stowe CC: Lars Strojny , Michael Shadle , Leigh , "internals@lists.php.net" References: <0960EAA5-17FF-4E0F-9DDE-BB93D13EA02B@gmail.com> <72B22976-6F00-4EF5-88B3-140576CFE4E7@gmail.com> <5059F033.80706@ajf.me> In-Reply-To: Content-Type: multipart/alternative; boundary="------------040409040704090601000507" Subject: Re: [PHP-DEV] RFC: Implementing a core anti-XSS escaping class From: ajf@ajf.me (Andrew Faulds) --------------040409040704090601000507 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 19/09/12 17:21, Michael Stowe wrote: > /"Oh goodness no, let's please only do OOP with the language features. > Creating ridiculous "procedural" OOP abstractions helps absolutely > nobody"/ > > Andrew, I'm the biggest advocate of OOP out there, but the purpose of > this is to provide a nice convenient layer for all developers to use > to properly escape code and increase security within their > applications. As such, we need to cater to the resistance...err, I > mean Procedural Purists and those who are beginning PHP development > and are not yet comfortable with OOP. > > - Mike I understand that. I don't mind a procedural API, something like: escape_html_attr($str, 'utf8'); with non-optional encoding. But a pseudo-OOP "procedural" API that merely uses a context instead of an actual object with methods is stupid. I cannot believe that newbies like myself are incapable of understanding that $ctx->escape($str) and escape($ctx, $str) are essentially equivalent. Besides, examples in the documentation can make this very simple to understand. -- Andrew Faulds http://ajf.me/ --------------040409040704090601000507--