Class HTMLSanitizer
- java.lang.Object
-
- de.hybris.platform.acceleratorstorefrontcommons.tags.HTMLSanitizer
-
public class HTMLSanitizer extends java.lang.ObjectThis file contains static methods that are used by JSP EL.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.owasp.html.FilterUrlByProtocolAttributePolicyURL_POLICY
-
Constructor Summary
Constructors Constructor Description HTMLSanitizer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringsanitizeHTML(java.lang.String untrustedHTML)JSP EL Function to sanitize unsafe HTML stringstatic booleanvalidateUrlScheme(java.lang.String dirtyUrl)Validate input URL scheme against declared URL Policy
-
-
-
Method Detail
-
sanitizeHTML
public static java.lang.String sanitizeHTML(java.lang.String untrustedHTML)
JSP EL Function to sanitize unsafe HTML string- Parameters:
untrustedHTML- potentially unsafe HTML string- Returns:
- safe HTML string with allowed elements only. All other elements that are not specified as allowed are removed.
-
validateUrlScheme
public static boolean validateUrlScheme(java.lang.String dirtyUrl)
Validate input URL scheme against declared URL Policy- Parameters:
the- dirtyUrl that needs to be validated- Returns:
- whether the URL is valid or not
-
-