Skip to content

Forced filter

Latest
Compare
Choose a tag to compare
@Aleksandr-ru Aleksandr-ru released this 15 Jun 11:53

Forced filter mechanism is now applied instead of default filter for variables.

Forced filter is filter applied to a variable first, if no "raw" filter is set and no same filter presents.
By default forced filter is set to "html" and could be changed via new methods (getter and setter).
Forced filter can contain several elements like html|nl2br, each will be prepended to variable's filters, if is not set.

Example:

Before 2.7 {{VAR}} means {{VAR|html}} and {{VAR|js}} means only {{VAR|js}} (no html applied).

Now {{VAR}} means {{VAR|html}} and {{VAR|js}} means {{VAR|html|js}} (html is forcefully prepended).

To get back old behaviour of {{VAR|js}} you need to add "raw" filter like {{VAR|raw|js}}.

New mechanism may cause some backwards compatibility issues, but in most cases everything works as usual.