Package sk.iway.iwcm.system.jpa
Class AllowSafeHtmlAttributeConverter
java.lang.Object
sk.iway.iwcm.system.jpa.AllowSafeHtmlAttributeConverter
public class AllowSafeHtmlAttributeConverter
extends Object
implements javax.persistence.AttributeConverter<String,String>
Attribute konverter pre JPA beany ktory umozni pouzit BEZPECNY HTML kod
podla odporucani OWASP: https://owasp.org/www-project-java-html-sanitizer/
ponechane je len zakladne HTML formatovanie
pouzitie: k fieldu ktory ma mat povoleny HTML kod zadajte anotaciu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToEntityAttribute
(String databaseValue) static String
Sanitize HTML code using Owasp HTML sanitizer, allowed is: - common inline formatting elements - common block elements - styling - a element - img element - href attribute on a element
-
Constructor Details
-
AllowSafeHtmlAttributeConverter
public AllowSafeHtmlAttributeConverter()
-
-
Method Details
-
convertToDatabaseColumn
-
convertToEntityAttribute
-
sanitize
Sanitize HTML code using Owasp HTML sanitizer, allowed is: - common inline formatting elements - common block elements - styling - a element - img element - href attribute on a element- Parameters:
unsafeHtml
-- Returns:
-