org.owasp.validator.html.scan
Class AntiSamyDOMScanner
java.lang.Object
org.owasp.validator.html.scan.AntiSamyDOMScanner
public class AntiSamyDOMScanner
- extends Object
This is where the magic lives. All the scanning/filtration logic resides here, but it should not be called
directly. All scanning should be done through a AntiSamy.scan() method.
- Author:
- Arshan Dabirsiaghi
ENCODING_ALGORITHM
public static final String ENCODING_ALGORITHM
- See Also:
- Constant Field Values
AntiSamyDOMScanner
public AntiSamyDOMScanner(Policy policy)
AntiSamyDOMScanner
public AntiSamyDOMScanner()
throws PolicyException
- Throws:
PolicyException
scan
public CleanResults scan(String html)
throws ScanException
- This is where the magic lives.
- Parameters:
html - A String whose contents we want to scan.
- Returns:
- A
CleanResults object with an XMLDocumentFragment object and its String representation, as well as some scan statistics.
- Throws:
ScanException
main
public static void main(String[] args)
throws PolicyException
- This method replaces all entity codes with a normalized version of all entity references contained in order to reduce our encoding/parsing
attack surface.
- Parameters:
txt - The string to be normalized.
- Throws:
PolicyException
getResults
public CleanResults getResults()
setResults
public void setResults(CleanResults results)