cms_escape

We need your assistance to make the documentation accurate, user friendly and understandable. Therefore we welcome any tips or suggestions regarding documentation. Thank you in advance for your contribution.

However, we will not respond to technical support questions submitted using this form. If you are having difficulty with CMSMS and cannot find the solution on this website, please submit your question appropriately on our support forum at: http://forum.cmsmadesimple.org. Please remember to follow the forum rules when posting.

CMS Made Simple™ Partner



   Purpose

This modifier is used to escape the string in one of many ways. This can be used for converting the string to multiple different display formats, or to make user entered data with special characters displayable on a standard web page.

   Usage

{$some_var_with_text|cms_escape[:<escape type>|[<character set>]]}

   Valid escape types

  • html (default) - use htmlspecialchars.
  • htmlall - use htmlentities.
  • url - raw url encode all entities.
  • urlpathinfo - Similar to the url escape type, but also encode /.
  • quotes - Escape unescaped single quotes.
  • hex - Escape every character into hex.
  • hexentity - Hex encode every character.
  • decentity - Decimal encode every character.
  • javascript - Escape quotes, backslashes, newlines etc.
  • mail - Encode an email address into something that is safe to display.
  • nonstd - Escape non standard characters, such as document quotes.

   Character Set

If the character set is not specified, utf-8 is assumed. The character set is only applicable to the "html" and "htmlall" escape types.