| Modifier and Type | Field and Description |
|---|---|
protected Map<String,List<String>> |
allowed |
protected String[] |
allowedEntities |
protected String[] |
allowedProtocols |
protected static boolean |
ALWAYS_MAKE_TAGS |
protected String[] |
needClosingTags |
protected String[] |
protocolAtts |
protected static int |
REGEX_FLAGS_SI |
protected String[] |
removeBlanks |
protected String[] |
selfClosingTags |
protected static boolean |
STRIP_COMMENTS |
protected Map<String,Integer> |
tagCounts |
| Constructor and Description |
|---|
XSSFilter() |
XSSFilter(String tag)
Creates an XSSFilter instance for which the submitted tag was removed from the internal the predefined
"allowed entities" list
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
balanceHTML(String userInput) |
protected String |
checkEntity(String preamble,
String term) |
protected String |
checkTags(String userInput) |
static String |
chr(int decimal) |
protected String |
decodeEntities(String userInput) |
protected String |
escapeComments(String userInput) |
String |
filter(String input)
given a user submitted input String, filter out any invalid or restricted html.
|
static String |
htmlSpecialChars(String specialHTMLChars) |
protected boolean |
isValidEntity(String entity) |
protected String |
processParamProtocol(String userInput) |
protected String |
processRemoveBlanks(String userInput) |
protected String |
processTag(String userInput) |
protected String |
regexReplace(String regex_pattern,
String replacement,
String userInput) |
void |
removeTagFromAllowedEntities(String tag)
In some cases (see PLA-8216) we want to exclude some html tags from the predefined (default) list
|
protected void |
reset() |
protected String |
validateEntities(String userInput) |
protected static final boolean ALWAYS_MAKE_TAGS
protected static final boolean STRIP_COMMENTS
protected static final int REGEX_FLAGS_SI
protected String[] selfClosingTags
protected String[] needClosingTags
protected String[] protocolAtts
protected String[] allowedProtocols
protected String[] removeBlanks
protected String[] allowedEntities
public XSSFilter()
public XSSFilter(String tag)
tag - html tag which will be excludedpublic void removeTagFromAllowedEntities(String tag)
tag - protected void reset()
public static String chr(int decimal)
public String filter(String input)
input - text (i.e. submitted by a user) than may contain htmlprotected String regexReplace(String regex_pattern, String replacement, String userInput)
protected boolean isValidEntity(String entity)
Copyright © 2017 SAP SE. All Rights Reserved.