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
-
public class InlineStyleCleaner extends AttributeCleaner
Clean HTMLstyle
attribute using a whitelist of authorized css properties.- Since:
- jcms-10.0.0 / JCMS-6170
-
-
Constructor Summary
Constructors Constructor Description InlineStyleCleaner()
Build a new cleaner
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
cleanSingleValue(java.lang.String cssProperty)
Clean individual value of the attribute.-
Methods inherited from class com.jalios.jcms.wysiwyg.safety.AttributeCleaner
clean, clean, configureFromProperties
-
Methods 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
-
-
-
-
Method Detail
-
cleanSingleValue
protected java.lang.String cleanSingleValue(java.lang.String cssProperty)
Description copied from class:AttributeCleaner
Clean 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:
cleanSingleValue
in 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)
-
-