[Yanel-commits] rev 50159 - public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search

michi at wyona.com michi at wyona.com
Thu Jun 3 13:57:08 CEST 2010


Author: michi
Date: 2010-06-03 13:57:07 +0200 (Thu, 03 Jun 2010)
New Revision: 50159

Modified:
   public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/SearchResource.java
Log:
escape XML of title

Modified: public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/SearchResource.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/SearchResource.java	2010-06-03 11:56:49 UTC (rev 50158)
+++ public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/SearchResource.java	2010-06-03 11:57:07 UTC (rev 50159)
@@ -96,9 +96,8 @@
                     for (int i = 0; i < results.length; i++) {
                         sb.append("<y:result url=\"" + results[i].getURL() + "\">");
                         if (results[i].getTitle() != null) {
-                            // TODO: Somehow the CDATA vanishes (maybe because of the serializer ...)
-                            //sb.append("  <y:title>" + results[i].getTitle() + "</y:title>");
-                            sb.append("  <y:title><![CDATA[" + results[i].getTitle() + "]]></y:title>");
+                            log.debug("Title: " + results[i].getTitle());
+                            sb.append("  <y:title>" + org.apache.commons.lang.StringEscapeUtils.escapeXml(results[i].getTitle()) + "</y:title>");
                         } else {
                             sb.append("  <y:no-title/>");
                         }



More information about the Yanel-commits mailing list