Revision: 14563
          http://gate.svn.sourceforge.net/gate/?rev=14563&view=rev
Author:   markagreenwood
Date:     2011-11-17 12:14:33 +0000 (Thu, 17 Nov 2011)
Log Message:
-----------
make sure we escape any HTML characters/entities in a feature value before 
using it to make a HTML based tooltip

Modified Paths:
--------------
    gate/trunk/src/gate/gui/docview/AnnotationStack.java

Modified: gate/trunk/src/gate/gui/docview/AnnotationStack.java
===================================================================
--- gate/trunk/src/gate/gui/docview/AnnotationStack.java        2011-11-17 
11:30:38 UTC (rev 14562)
+++ gate/trunk/src/gate/gui/docview/AnnotationStack.java        2011-11-17 
12:14:33 UTC (rev 14563)
@@ -23,6 +23,9 @@
 import javax.swing.border.CompoundBorder;
 import javax.swing.border.EtchedBorder;
 import javax.swing.border.EmptyBorder;
+
+import org.apache.commons.lang.StringEscapeUtils;
+
 import java.util.*;
 import java.awt.*;
 
@@ -342,9 +345,9 @@
               + map.getKey() + "</strong></td><td>"
               + ((Strings.toString(map.getValue()).length() > 500) ?
               "<textarea rows=\"20\" cols=\"40\" cellspacing=\"0\">"
-                + 
(Strings.toString(map.getValue())).replaceAll("(.{50,60})\\b", "$1\n")
+                + 
StringEscapeUtils.escapeHtml(Strings.toString(map.getValue()).replaceAll("(.{50,60})\\b",
 "$1\n"))
                 + "</textarea>" :
-              Strings.toString(map.getValue()).replaceAll("\n", "<br>"))
+              
StringEscapeUtils.escapeHtml(Strings.toString(map.getValue())).replaceAll("\n", 
"<br>"))
               + "</td></tr>";
             odd = !odd;
           }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to