Author: itthkjer
Date: 2006-04-04 19:56:23 +0200 (Tue, 04 Apr 2006)
New Revision: 2707
Modified:
branches/MOBILE_SESAM/src/java/no/schibstedsok/front/searchportal/velocity/WikiDirective.java
Log:
enodes url
Modified:
branches/MOBILE_SESAM/src/java/no/schibstedsok/front/searchportal/velocity/WikiDirective.java
===================================================================
---
branches/MOBILE_SESAM/src/java/no/schibstedsok/front/searchportal/velocity/WikiDirective.java
2006-04-04 16:00:03 UTC (rev 2706)
+++
branches/MOBILE_SESAM/src/java/no/schibstedsok/front/searchportal/velocity/WikiDirective.java
2006-04-04 17:56:23 UTC (rev 2707)
@@ -10,7 +10,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.lang.WordUtils;
+import org.apache.commons.lang.StringEscapeUtils;
+import java.net.URLEncoder;
+
import java.io.Writer;
import java.io.IOException;
@@ -70,8 +73,13 @@
}
String s = node.jjtGetChild(0).value(context).toString();
+ String wap = s.replace("no.wikipedia.org/wiki", "no.wapedia.org");
+
+ //String cut = wap.substring(0, wap.lastIndexOf("/")+1);
+ //String wikiword =
URLEncoder.encode(s.substring(s.lastIndexOf("/")+1), "UTF-8");
+ //writer.write(cut+wikiword);
- writer.write(s.replace("no.wikipedia.org/wiki", "no.wapedia.org"));
+ writer.write(StringEscapeUtils.escapeXml(wap));
Token lastToken = node.getLastToken();
_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits