jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r544281 - /jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultHighlighter.java
Date Mon, 04 Jun 2007 21:33:37 GMT
Author: jukka
Date: Mon Jun  4 14:33:36 2007
New Revision: 544281

URL: http://svn.apache.org/viewvc?view=rev&rev=544281
Log:
1.3: Merged revision 531165 (JCR-859)

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

Modified: jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultHighlighter.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultHighlighter.java?view=diff&rev=544281&r1=544280&r2=544281
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultHighlighter.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultHighlighter.java
Mon Jun  4 14:33:36 2007
@@ -26,6 +26,7 @@
 import org.apache.lucene.index.TermPositionVector;
 import org.apache.lucene.index.TermVectorOffsetInfo;
 import org.apache.lucene.index.Term;
+import org.apache.jackrabbit.util.Text;
 
 /**
  * This is an adapted version of the <code>FulltextHighlighter</code> posted
in
@@ -196,7 +197,8 @@
                     if (skippedChars > surround) {
                         skippedChars = surround;
                     }
-                    sb.append(cbuf, 0, surround - skippedChars);
+                    sb.append(Text.encodeIllegalXMLCharacters(
+                            new String(cbuf, 0, surround - skippedChars)));
                     sb.append(END_FRAGMENT_SEPARATOR);
                 }
             }
@@ -223,7 +225,8 @@
                 }
             }
 
-            sb.append(cbuf, skippedChars, cbuf.length - skippedChars);
+            sb.append(Text.encodeIllegalXMLCharacters(
+                    new String(cbuf, skippedChars, cbuf.length - skippedChars)));
 
             // iterate terms
             for (Iterator iter = fi.iterator(); iter.hasNext();) {
@@ -267,7 +270,8 @@
                 } else {
                     skippedChars = 0;
                 }
-                sb.append(cbuf, 0, EOF ? skip : (surround - skippedChars));
+                sb.append(Text.encodeIllegalXMLCharacters(
+                        new String(cbuf, 0, EOF ? skip : (surround - skippedChars))));
                 sb.append(END_FRAGMENT_SEPARATOR);
             }
         }



Mime
View raw message