|
Liferay 7.0-ce-m3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Sanitizer
Provides an interface and constants for sanitizer component implementations.
Commonly, sanitizers are implemented for stripping offensive vocabulary from
content or for removing malicious HTML content, such as cross-site scripting
(CSS). Multiple implementations can be deployed in a hook plugin and
specified in a comma separated list of values for the
sanitizer.impl portal property (see Sanitizer).
All installed sanitizers are chained.
| Field Summary | |
|---|---|
static String |
MODE_ALL
|
static String |
MODE_BAD_WORDS
|
static String |
MODE_XSS
|
| Method Summary | |
|---|---|
byte[] |
sanitize(long companyId,
long groupId,
long userId,
String className,
long classPK,
String contentType,
String[] modes,
byte[] bytes,
Map<String,Object> options)
Returns the sanitized content as a byte array. |
void |
sanitize(long companyId,
long groupId,
long userId,
String className,
long classPK,
String contentType,
String[] modes,
InputStream inputStream,
OutputStream outputStream,
Map<String,Object> options)
Sanitizes the input stream content, assigning the results to the output stream. |
String |
sanitize(long companyId,
long groupId,
long userId,
String className,
long classPK,
String contentType,
String[] modes,
String s,
Map<String,Object> options)
Returns the sanitized content as a string. |
| Field Detail |
|---|
static final String MODE_ALL
static final String MODE_BAD_WORDS
static final String MODE_XSS
| Method Detail |
|---|
byte[] sanitize(long companyId,
long groupId,
long userId,
String className,
long classPK,
String contentType,
String[] modes,
byte[] bytes,
Map<String,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 sanitizer
SanitizerException - if a sanitizer exception occurred
void sanitize(long companyId,
long groupId,
long userId,
String className,
long classPK,
String contentType,
String[] modes,
InputStream inputStream,
OutputStream outputStream,
Map<String,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 sanitizer
SanitizerException - if a sanitizer exception occurred
String sanitize(long companyId,
long groupId,
long userId,
String className,
long classPK,
String contentType,
String[] modes,
String s,
Map<String,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 map
SanitizerException - if a sanitizer exception occurred
|
Liferay 7.0-ce-m3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||