Package com.jalios.jcms.wysiwyg.safety
Class InlineStyleCleaner
java.lang.Object
com.jalios.jcms.wysiwyg.safety.Cleaner
com.jalios.jcms.wysiwyg.safety.AttributeCleaner
com.jalios.jcms.wysiwyg.safety.InlineStyleCleaner
Clean HTML
style attribute
using a whitelist of authorized css properties.- Since:
- jcms-10.0.0 / JCMS-6170
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcleanSingleValue(String cssProperty) Clean individual value of the attribute.Methods inherited from class com.jalios.jcms.wysiwyg.safety.AttributeCleaner
clean, clean, configureFromPropertiesMethods inherited from class com.jalios.jcms.wysiwyg.safety.Cleaner
addBlacklistedValue, addWhitelistedValue, getBlacklist, getBlacklistRegex, getDefaultBehavior, getWhitelist, getWhitelistRegex, isAuthorized, isEnabled, removeBlacklistedValue, removeWhitelistedValue, setBlacklistRegex, setDefaultBehavior, setEnabled, setWhitelistRegex, toString
-
Constructor Details
-
InlineStyleCleaner
public InlineStyleCleaner()Build a new cleaner
-
-
Method Details
-
cleanSingleValue
Description copied from class:AttributeCleanerClean individual value of the attribute.When attributes accept several values (such as "class" attribute), this method is invoked for each of this value.
When attributes accept only one value (such as "id" attribute), this method is invoked one for the whole attribute value.Override to provide custom cleaning behavior.
- Overrides:
cleanSingleValuein classAttributeCleaner- Parameters:
cssProperty- the unsafe attribute value (or "split" value in case multiple values)- Returns:
- a safe sanitized value (or empty string if no value was kept, never return null)
-