jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r935557 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultHighlighter.java
Date Mon, 19 Apr 2010 13:25:40 GMT
Author: jukka
Date: Mon Apr 19 13:25:40 2010
New Revision: 935557

URL: http://svn.apache.org/viewvc?rev=935557&view=rev
Log:
JCR-2611: DefaultHighlighter.java does not encode illegal XML characters

Patch by Peter Krokavec.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultHighlighter.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultHighlighter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultHighlighter.java?rev=935557&r1=935556&r2=935557&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultHighlighter.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultHighlighter.java
Mon Apr 19 13:25:40 2010
@@ -307,7 +307,8 @@ public class DefaultHighlighter {
                     cbuf = new char[nextStart - pos];
                     int charsRead = reader.read(cbuf, 0, nextStart - pos);
                     pos += (nextStart - pos);
-                    sb.append(cbuf, 0, charsRead);
+                    sb.append(Text.encodeIllegalXMLCharacters(
+                            new String(cbuf, 0, charsRead)));
                 }
                 sb.append(hlStart);
                 nextStart = ti.getEndOffset();
@@ -315,7 +316,8 @@ public class DefaultHighlighter {
                 cbuf = new char[nextStart - pos];
                 reader.read(cbuf, 0, nextStart - pos);
                 pos += (nextStart - pos);
-                sb.append(cbuf);
+                sb.append(Text.encodeIllegalXMLCharacters(
+                        new String(cbuf)));
                 sb.append(hlEnd);
             }
         }



Mime
View raw message