|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.util.BambooStringUtils
public class BambooStringUtils
Field Summary | |
---|---|
static char |
CHAR_APOSTROPHE
|
static char |
CHAR_BACKSLASH
|
static char |
CHAR_DOUBLE_QUOTE
|
static char |
CHAR_NONE
|
Method Summary | |
---|---|
static boolean |
containsXssRelatedCharacters(java.lang.String string)
Returns true if the supplied string contains characters that could be used to deface a page or trigger an XSS exploit (characters: "&'<>\). |
static java.lang.String |
encodeHtmlWithTagWhiteList(java.lang.String string)
Escapes string but preserves few defined tags. |
static com.google.common.base.Function<java.lang.String,java.lang.String> |
encodeHtmlWithTagWhiteListFunction()
|
static java.lang.String |
forceAlphaNumeric(java.lang.String str)
|
static java.lang.String |
forceValidHtmlId(java.lang.String id)
According to the HTML standard, ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). |
static java.lang.String |
getFirstXssRelatedCharacter(java.lang.String string)
Retrieves first unsafe character from supplied string |
static java.lang.String |
remove(java.lang.String quotedVarValue,
int index)
Removes a character at specified index from string |
static java.lang.String |
unquote(java.lang.String quotedVarValue,
boolean processBackslashes)
Removes quotes from variable using shell rules. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char CHAR_NONE
public static final char CHAR_APOSTROPHE
public static final char CHAR_BACKSLASH
public static final char CHAR_DOUBLE_QUOTE
Method Detail |
---|
@NotNull public static java.lang.String forceAlphaNumeric(@Nullable java.lang.String str)
public static boolean containsXssRelatedCharacters(@Nullable java.lang.String string)
string
- string to check
@NotNull public static java.lang.String getFirstXssRelatedCharacter(@Nullable java.lang.String string)
string
- the string to check
@NotNull public static java.lang.String forceValidHtmlId(@NotNull java.lang.String id)
public static java.lang.String encodeHtmlWithTagWhiteList(java.lang.String string)
string
-
public static com.google.common.base.Function<java.lang.String,java.lang.String> encodeHtmlWithTagWhiteListFunction()
@NotNull public static java.lang.String unquote(@NotNull java.lang.String quotedVarValue, boolean processBackslashes)
quotedVarValue
- processBackslashes
- whether backslash should be treated as a special character or not
@NotNull public static java.lang.String remove(@NotNull java.lang.String quotedVarValue, int index)
quotedVarValue
- index
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |