public class HtmlSanitizerServiceImpl extends DefaultComponent implements HtmlSanitizerService
Modifier and Type | Field and Description |
---|---|
LinkedList<HtmlSanitizerAntiSamyDescriptor> |
allPolicies
All policies registered.
|
List<HtmlSanitizerDescriptor> |
allSanitizers
All sanitizers registered.
|
static String |
ANTISAMY_XP |
org.owasp.validator.html.Policy |
policy
Effective policy.
|
static String |
SANITIZER_XP |
List<HtmlSanitizerDescriptor> |
sanitizers
Effective sanitizers.
|
lastModified
Constructor and Description |
---|
HtmlSanitizerServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
addAntiSamy(HtmlSanitizerAntiSamyDescriptor desc) |
protected void |
addSanitizer(HtmlSanitizerDescriptor desc) |
protected org.owasp.validator.html.Policy |
getPolicy() |
protected List<HtmlSanitizerDescriptor> |
getSanitizers() |
protected void |
refreshPolicy() |
protected void |
refreshSanitizers() |
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
protected void |
removeAntiSamy(HtmlSanitizerAntiSamyDescriptor desc) |
protected void |
removeSanitizer(HtmlSanitizerDescriptor desc) |
void |
sanitizeDocument(DocumentModel doc)
Sanitizes a document's fields, depending on the service configuration.
|
String |
sanitizeString(String string,
String info)
Sanitizes a string.
|
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
activate, applicationStarted, deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, setModifiedNow, unregisterExtension
public static final String ANTISAMY_XP
public static final String SANITIZER_XP
public LinkedList<HtmlSanitizerAntiSamyDescriptor> allPolicies
public org.owasp.validator.html.Policy policy
public List<HtmlSanitizerDescriptor> allSanitizers
public List<HtmlSanitizerDescriptor> sanitizers
public HtmlSanitizerServiceImpl()
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
protected void addAntiSamy(HtmlSanitizerAntiSamyDescriptor desc)
protected void removeAntiSamy(HtmlSanitizerAntiSamyDescriptor desc)
protected void refreshPolicy()
protected org.owasp.validator.html.Policy getPolicy()
protected void addSanitizer(HtmlSanitizerDescriptor desc)
protected void removeSanitizer(HtmlSanitizerDescriptor desc)
protected void refreshSanitizers()
protected List<HtmlSanitizerDescriptor> getSanitizers()
public void sanitizeDocument(DocumentModel doc)
HtmlSanitizerService
sanitizeDocument
in interface HtmlSanitizerService
public String sanitizeString(String string, String info)
HtmlSanitizerService
sanitizeString
in interface HtmlSanitizerService
string
- the string to sanitizeinfo
- additional info logged when something is sanitizedCopyright © 2015 Nuxeo SA. All rights reserved.