Package com.avoka.core.util
Class XssUtils
java.lang.Object
com.avoka.core.util.XssUtils
Provides XSS utilities.
- Since:
- 4.2.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringisXmlDocumentSafe(Document document) Checks if is XML document does not contain any XSS characters.static booleanChecks if is XML document does not contain any XSS characters.static booleanisXmlTextSafe(String xmlText) Return true if the XML text does not contain any XSS characters, or false otherwise.static booleanChecks if the value is XSS safe.static booleanisXssSafeFilename(String value) Checks if the filename value is XSS safe.
-
Constructor Details
-
XssUtils
public XssUtils()
-
-
Method Details
-
isXssSafe
Checks if the value is XSS safe. Please see dangerous characters: XSS Filter Evasion Cheat Sheet- Parameters:
value- the value to test- Returns:
- true, if is XSS safe or is null
-
isXssSafeFilename
Checks if the filename value is XSS safe. This applies the standard XSS checks except 'document.' and 'window.' values. Please see dangerous characters: XSS Filter Evasion Cheat Sheet- Parameters:
value- the value to test- Returns:
- true, if is XSS safe or is null
- Since:
- 4.3.3
-
isXmlSafe
Checks if is XML document does not contain any XSS characters. Note the XML document < character is ignored. Please see dangerous characters: XSS Filter Evasion Cheat Sheet- Parameters:
document- the XML document to test (required)- Returns:
- true, if is XSS safe or is null
- Since:
- 4.2.5
-
isXmlDocumentSafe
Checks if is XML document does not contain any XSS characters. Please see dangerous characters: XSS Filter Evasion Cheat Sheet- Parameters:
document- the XML document to test (required)- Returns:
- null if is XSS safe or the offending token
- Since:
- 4.3.4
-
isXmlTextSafe
Return true if the XML text does not contain any XSS characters, or false otherwise. Please see dangerous characters: XSS Filter Evasion Cheat Sheet- Parameters:
xmlText- the XML text to test (required)- Returns:
- true, if is XSS safe or false otherwise
- Since:
- 5.0.0
-