|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opencms.util.CmsParameterEscaper
public class CmsParameterEscaper
This class is responsible for automatically escaping parameters in Flex requests. It keeps track of which parameters to escape (or not escape), and which parameters need to be processed by AntiSamy.
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_POLICY
The file name of the default policy. |
protected static org.owasp.validator.html.Policy |
defaultPolicy
The default policy, which is used when no policy path is given. |
| Constructor Summary | |
|---|---|
CmsParameterEscaper()
|
|
| Method Summary | |
|---|---|
org.owasp.validator.html.AntiSamy |
createAntiSamy(CmsObject cms,
java.lang.String policyPath)
Creates a new AntiSamy instance for a given policy path. |
void |
enableAntiSamy(CmsObject cms,
java.lang.String policyPath,
java.util.Set<java.lang.String> params)
Enables the AntiSamy HTML cleaning for some parameters. |
java.lang.String |
escape(java.lang.String name,
java.lang.String html)
Escapes a single parameter value. |
java.lang.String[] |
escape(java.lang.String name,
java.lang.String[] values)
Escapes an array of parameter values. |
java.lang.String |
filterAntiSamy(java.lang.String html)
Filters HTML input using the internal AntiSamy instance. |
static org.owasp.validator.html.Policy |
readPolicy(CmsObject cms,
java.lang.String sitePath)
Helper method for reading an AntiSamy policy file from the VFS. |
void |
setExceptions(java.util.Collection<java.lang.String> exceptions)
Sets the set of names of parameters which shouldn't be escaped. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_POLICY
protected static org.owasp.validator.html.Policy defaultPolicy
| Constructor Detail |
|---|
public CmsParameterEscaper()
| Method Detail |
|---|
public static org.owasp.validator.html.Policy readPolicy(CmsObject cms,
java.lang.String sitePath)
cms - the current CMS contextsitePath - the site path of the policy file
public org.owasp.validator.html.AntiSamy createAntiSamy(CmsObject cms,
java.lang.String policyPath)
cms - the current CMS contextpolicyPath - the policy site path
public void enableAntiSamy(CmsObject cms,
java.lang.String policyPath,
java.util.Set<java.lang.String> params)
cms - the current CMS contextpolicyPath - the policy site path in the VFSparams - the parameters for which HTML cleaning should be enabled
public java.lang.String escape(java.lang.String name,
java.lang.String html)
name - the name of the parameterhtml - the value of the parameter
public java.lang.String[] escape(java.lang.String name,
java.lang.String[] values)
name - the parameter namevalues - the parameter values
public java.lang.String filterAntiSamy(java.lang.String html)
html - the HTML to filter
public void setExceptions(java.util.Collection<java.lang.String> exceptions)
exceptions - a set of parameter names
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||