Closed Amaury closed 1 week ago
This is looking great, @Amaury !
How do you propose we release this? Do you think this calls for a new major version, i.e. Smarty v6 or a minor (v5.4)?
One might argue this requires a major, because behavior is changing for existing templates that use |escape
of some form when html auto-escaping is also enabled. On the other hand: that would very likely be unintended anyway.
About the release, I would say that a minor version should be enough; I don't know if anybody if really using auto-escaping and |escape
at the same time. On the other hand, it's true this is a deep change of behaviour…
I don't know, I let you choose ^^'
Thank you! :)
In the end, do you think you will create a major version or a minor one?
I'm thinking minor.
This evolution improves the auto-escaping feature.
escape
modifier has no effect when auto-escaping is enabled (when no escape format is given, or when thehtml
format is used), to prevent double-escaping.escape
modifier (htmlall
,url
,urlpathinfo
,quotes
,javascript
) are processed as we may expect, without double-escaping.force
format of theescape
modifier allows to force double-escaping if needed.raw
modifier temporary disables auto-escaping for the expression it is used on.This Pull Request contains the source code of this evolution, as well as its documentation and unit tests.