Package org.xwiki.xml.html.script
Class HTMLScriptService
- java.lang.Object
-
- org.xwiki.xml.html.script.HTMLScriptService
-
- All Implemented Interfaces:
ScriptService
@Unstable @Component @Named("html") @Singleton public class HTMLScriptService extends Object implements ScriptService
Script service dedicated to perform operations on html scripts.- Since:
- 14.10.4, 15.0RC1
- Version:
- $Id: cbc6a1e1b1a8e7c7505e9454959bbcd5717763e5 $
-
-
Constructor Summary
Constructors Constructor Description HTMLScriptService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isAttributeSafe(String elementName, String attributeName, String value)
Check if the attribute and its value can be considered safe or not.boolean
isElementSafe(String elementName)
Check if the given html element can be considered safe or not.
-
-
-
Method Detail
-
isElementSafe
public boolean isElementSafe(String elementName)
Check if the given html element can be considered safe or not. The definition of safe is based on the implementation of the configuredHTMLElementSanitizer
. By default it should useSecureHTMLElementSanitizer
which itself relies partly on the configuration of the wiki (seeHTMLElementSanitizerConfiguration
).- Parameters:
elementName
- the name of the HTML element- Returns:
true
if the given element is allowed in principle (given appropriate attributes)
-
isAttributeSafe
public boolean isAttributeSafe(String elementName, String attributeName, String value)
Check if the attribute and its value can be considered safe or not. The definition of safe is based on the implementation of the configuredHTMLElementSanitizer
. By default it should useSecureHTMLElementSanitizer
which itself relies partly on the configuration of the wiki (seeHTMLElementSanitizerConfiguration
).- Parameters:
elementName
- the element for which the attributes shall be checkedattributeName
- the attributes to checkvalue
- the value of the attribute- Returns:
true
if the attribute with this value is considered safe
-
-