Re: [RFC] New operator for context-dependent escaping
| From: | Michael Vostrikov | Date: | Tue, 19 Jul 2016 19:27:52 +0000 |
| Subject: | Re: [RFC] New operator for context-dependent escaping | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-94579@lists.php.net to get a copy of this message | ||
A couple of thoughts.
Let's just remove default implementation of PHPEscaper. This is not hard to
define own class, in a global namespace or with 'use'.
Maybe allow to pass not limited set of arguments? E.g. like <?* $str,
'my_context', 'param', 'another_param' ?>
This can be used for all context-dependent text transformations - not just
for escaping, but also for translation, date and number formatting, etc.
<?* $message, 'translate', $messageCategory ?>
Maybe use ':' as a special sign? "<?: ?>" is more comfortable to type.