Re: [RFC] Escaping RFC for PHP Core - Updates?
| From: | Levi Morrison | Date: | Sat, 07 Sep 2013 14:41:38 +0000 |
| Subject: | Re: [RFC] Escaping RFC for PHP Core - Updates? | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-68942@lists.php.net to get a copy of this message | ||
> 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.