Skip to content
Snippets Groups Projects
Commit f6850307 authored by cramakri's avatar cramakri
Browse files

LMS-1767 Specified some properties that should never be escaped.

SVN: 18607
parent 8b89b04b
No related branches found
No related tags found
No related merge requests found
...@@ -157,10 +157,24 @@ class ReflectingStringEscaperUnrestricted<T> extends ReflectingStringEscaperImpl ...@@ -157,10 +157,24 @@ class ReflectingStringEscaperUnrestricted<T> extends ReflectingStringEscaperImpl
private static class Visitor implements ReflectionStringTraverser.ReflectionFieldVisitor private static class Visitor implements ReflectionStringTraverser.ReflectionFieldVisitor
{ {
private final HashSet<String> unescapedProperties;
private Visitor()
{
unescapedProperties = new HashSet<String>();
// Don't escape these properties
unescapedProperties.add("permlink");
}
public String tryVisit(String value, Object object, Field fieldOrNull) public String tryVisit(String value, Object object, Field fieldOrNull)
{ {
// Only change the value if the name of the field is in the list provided
if (null == fieldOrNull) if (null == fieldOrNull)
{
return StringEscapeUtils.escapeHtml(value);
}
// Don't escape the ones that are specified as not to be escaped
if (unescapedProperties.contains(fieldOrNull.getName()))
{ {
return null; return null;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment