Class Attribute
java.lang.Object
org.owasp.validator.html.model.Attribute
A model for HTML attributes and the "rules" they must follow (either literals or regular
expressions) in order to be considered valid.
- Author:
- Arshan Dabirsiaghi, Kristian Rosenvold
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsAllowedValue(String valueInLowerCase) getName()matcherRegEx(boolean hasNext) booleanmatchesAllowedExpression(String value) static StringmergeRelValuesInAnchor(boolean addNofollow, boolean addNoopenerAndNoreferrer, String currentRelValue) This method takes the currentrelattribute values and, depending on which ones to add, appends the corresponding values if they are not already present.
-
Constructor Details
-
Attribute
-
-
Method Details
-
matchesAllowedExpression
-
containsAllowedValue
-
getName
-
getOnInvalid
- Returns:
- The
onInvalidvalue a tag could have, from the list of "filterTag", "removeTag" and "removeAttribute"
-
mutate
-
matcherRegEx
-
mergeRelValuesInAnchor
public static String mergeRelValuesInAnchor(boolean addNofollow, boolean addNoopenerAndNoreferrer, String currentRelValue) This method takes the currentrelattribute values and, depending on which ones to add, appends the corresponding values if they are not already present. It is meant to be used with anchor tags.- Parameters:
addNofollow- Specifies if"nofollow"value should be added in case it is not present.addNoopenerAndNoreferrer- Specifies if"noopener noreferrer"value should be added in case it is not present.currentRelValue- Currentrelattribute value, it will be merged with the values specified from the previous parameters.- Returns:
- The new
relattribute value to replace in an anchor tag.
-