Skip to the content
Documentation

wash

No ratings yet

Summary

Returns an HTML-safe version of the input string.

Usage

input|wash( [type] )

Parameters

Name Type Description Required
type string The type of text that should be washed. No.

Returns

An HTML-safe version of the input string.

Description

This operator translates the input string into an HTML friendly version. It will take care of converting bogus characters to HTML-friendly replacements. The "type" parameter can be used to specify the washing type, it can be set to either "xhtml" or "email" (the default is "xhtml"). E-mail washing can be controlled using the setting of the [WashSettings] configuration block of "template.ini". All strings that may break the HTML should always be washed using this operator.

Examples

Example 1

{'Bogus & stuff <'|wash()}
The following output will be produced: "Bogus & stuff <".

Example 2

{'[email protected]'|wash( 'email' )}

The following output will be produced:

hello<span class="spamfilter">SPAMFILTER</span>@example.com

Example 3

{'[email protected]'|wash( 'email' )}

If a configuration override for "template.ini" exists and contains...

[WashSettings]
EmailDotText=[dot]
EmailAtText=[at]

 

...the following output will be produced: "hello[at]example[dot]com".

Contributors

Comments (1 historical)

Written by readers of the earlier documentation sites, kept as they were.

  1. Additional parameters "javascript" & "pdf"

    Bruce Morrison ·

    The wash operator will also take "javascript" & "pdf" as parameter

Comments

Add a comment

Comments are read by a moderator before they appear.