[PHP-DEV] Re: TOKEN_AS_OBJECT for token_get_all()

2017-03-23 Thread Jan Tvrdík
On Thu, 23 Mar 2017 18:16:31 +0100, Nikita Popov wrote: Hi internals, I'd like to add a new TOKEN_AS_OBJECT flag to token_get_all(), which returns an array of PhpToken objects, rather than the mix of plain strings and arrays we currently have. The PhpToken class is defined as: class PhpT

Re: [PHP-DEV] RFC about automatic template escaping

2016-03-22 Thread Jan Tvrdík
On Tue, 22 Mar 2016 14:01:09 +0100, Craig Duncan wrote: Why do you assume that Latte parser is limited by regexp ability to parse HTML? Because it is: https://github.com/nette/latte/blob/19b759b550caaad75ca0dee5f0d85f9ffb59c845/src/Latte/Parser.php#L124 No. That argument would only be

Re: [PHP-DEV] RFC about automatic template escaping

2016-03-22 Thread Jan Tvrdík
On Tue, 22 Mar 2016 13:32:58 +0100, Marco Pivetta wrote: On 22 March 2016 at 13:24, Jan Tvrdík wrote: The escape context could be detected (e.g. Latte template engine supports context-aware escaping for years – https://latte.nette.org/en/#toc-context-aware-escaping) but the logic is

Re: [PHP-DEV] RFC about automatic template escaping

2016-03-22 Thread Jan Tvrdík
On Mon, 21 Mar 2016 07:35:46 +0100, Daniel Beardsley wrote: Issue is "Escaping is done on a specific context". I understand your proposal is focused on HTML escaping. However, setting names like __auto_escape_exempt_class is not good choice. It has to be __auto_html_escape_exempt_class at le