| java.lang.Object net.jforum.util.SafeHtml
SafeHtml | public class SafeHtml (Code) | | Process text with html and remove possible malicious tags and attributes.
Work based on tips from Amit Klein and the following documents:
http://ha.ckers.org/xss.html
http://quickwired.com/kallahar/smallprojects/php_xss_filter_function.php
author: Rafael Steil version: $Id: SafeHtml.java,v 1.25 2007/09/19 14:08:57 rafaelsteil Exp $ |
ensureAllAttributesAreSafe | public String ensureAllAttributesAreSafe(String contents)(Code) | | Given an input, analyze each HTML tag and remove unsecure attributes from them.
Parameters: contents - The content to verify the content, secure. |
makeSafe | public String makeSafe(String contents)(Code) | | Given an input, makes it safe for HTML displaying.
Removes any not allowed HTML tag or attribute, as well
unwanted Javascript statements inside the tags.
Parameters: contents - the input to analyze the modified and safe string |
|
|