Toggle menu

helper.utilHtmlEsc(text)

Returns an escaped version of the supplied text.

This will ensure that if the text is then displayed by a web browser it will not be interpreted as HTML. This helps prevent cross site scripting (XSS) attacks by preventing the injection of rogue JavaScript expressions.

Arguments

ArgumentTypeDescription
textString, requiredThe text to escape

Example

In this example the variable 'STUFF' has the value <p>.

helper.utilHtmlEsc(helper.getVariable('STUFF'))

Returns

"&lt;p&gt;"

Last modified on March 06, 2020

Share this page

Facebook icon Twitter icon email icon

Print

print icon