wwUtils::EncodeHtml

This method fixes up HTML for display. Takes HTML and XML tags and converts them to HTML displayable characters (&lt; for < for example).

Note that this method only translates quotes, ampersands and angle brackets (<>"&).

This method should be used to make HTML safe for display in browsers. By encoding angle brackets the string becomes 'displayable' where otherwise it would render the embedded tags as HTML. It also helps with preventing cross-site scripting attacks which are created by embedding <script> links into text and echo'd back. HtmlEncoded text will display script tags rather than execute them.

o.EncodeHtml(lcHTML)

Return Value

Fixed up HTML

Parameters

lcHTML
HTML to fix up.


See also:

Library wwUtils | wwUtils::DecodeHtml

© West Wind Technologies, 1996-2018 • Updated: 10/03/14
Comment or report problem with topic