public interface Sanitizer
sanitizer.impl portal property (see Sanitizer).
All installed sanitizers are chained.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MODE_ALL |
static java.lang.String |
MODE_BAD_WORDS |
static java.lang.String |
MODE_XSS |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
sanitize(long companyId,
long groupId,
long userId,
java.lang.String className,
long classPK,
java.lang.String contentType,
java.lang.String[] modes,
byte[] bytes,
java.util.Map<java.lang.String,java.lang.Object> options)
Returns the sanitized content as a byte array.
|
void |
sanitize(long companyId,
long groupId,
long userId,
java.lang.String className,
long classPK,
java.lang.String contentType,
java.lang.String[] modes,
java.io.InputStream inputStream,
java.io.OutputStream outputStream,
java.util.Map<java.lang.String,java.lang.Object> options)
Sanitizes the input stream content, assigning the results to the output
stream.
|
java.lang.String |
sanitize(long companyId,
long groupId,
long userId,
java.lang.String className,
long classPK,
java.lang.String contentType,
java.lang.String[] modes,
java.lang.String s,
java.util.Map<java.lang.String,java.lang.Object> options)
Returns the sanitized content as a string.
|
static final java.lang.String MODE_ALL
static final java.lang.String MODE_BAD_WORDS
static final java.lang.String MODE_XSS
byte[] sanitize(long companyId,
long groupId,
long userId,
java.lang.String className,
long classPK,
java.lang.String contentType,
java.lang.String[] modes,
byte[] bytes,
java.util.Map<java.lang.String,java.lang.Object> options)
throws SanitizerException
companyId - the primary key of the portal instancegroupId - the primary key of the site's groupuserId - the user who changed the contentclassName - the class name of the content model implementationclassPK - the primary key of the content to sanitize,
0 if not availablecontentType - the content type. For more information, see ContentTypes.modes - ways in which to run the sanitizer, such as MODE_ALL, MODE_BAD_WORDS, and/or MODE_XSSbytes - the content to be sanitizedoptions - a map of options for the sanitizerSanitizerException - if a sanitizer exception occurredvoid sanitize(long companyId,
long groupId,
long userId,
java.lang.String className,
long classPK,
java.lang.String contentType,
java.lang.String[] modes,
java.io.InputStream inputStream,
java.io.OutputStream outputStream,
java.util.Map<java.lang.String,java.lang.Object> options)
throws SanitizerException
companyId - the primary key of the portal instancegroupId - the primary key of the site's groupuserId - the user who changed the contentclassName - the class name of the content model implementationclassPK - the primary key of the content to sanitize,
0 if not availablecontentType - the content type. For more information, see ContentTypes.modes - ways in which to run the sanitizer, such as MODE_ALL, MODE_BAD_WORDS, and/or MODE_XSSinputStream - the content to be sanitizedoutputStream - the result of the sanitizing processoptions - a map of options for the sanitizerSanitizerException - if a sanitizer exception occurredjava.lang.String sanitize(long companyId,
long groupId,
long userId,
java.lang.String className,
long classPK,
java.lang.String contentType,
java.lang.String[] modes,
java.lang.String s,
java.util.Map<java.lang.String,java.lang.Object> options)
throws SanitizerException
companyId - the primary key of the portal instancegroupId - the primary key of the site's groupuserId - the user who changed the contentclassName - the class name of the content model implementationclassPK - the primary key of the content to sanitize,
0 if not availablecontentType - the content type. For more information, see ContentTypes.modes - ways in which to run the sanitizer, such as MODE_ALL, MODE_BAD_WORDS, and/or MODE_XSSs - the content to sanitizeoptions - the options mapSanitizerException - if a sanitizer exception occurred