Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) escaping special chars in the url properly - was a problem for QuickCrawlLink_p.xml

thelibab74b049924
diff --git a/htroot/QuickCrawlLink_p.java b/htroot/QuickCrawlLink_p.java
index 8926c016c..3a176c9f2 100644
--- a/htroot/QuickCrawlLink_p.java
+++ b/htroot/QuickCrawlLink_p.java
@@ -121,9 +121,19 @@ public class QuickCrawlLink_p {
boolean xsstopw = post.get("xsstopw", "").equals("on");
boolean xdstopw = post.get("xdstopw", "").equals("on");
boolean xpstopw = post.get("xpstopw", "").equals("on");
+
+ String escapedTitle = (title==null)?"unknown":title.replaceAll("&","&")
+ .replaceAll("<", "&lt;")
+ .replaceAll(">", "&gt;")
+ .replaceAll("\"", "&quot;");
- prop.put("mode_url",(crawlingStart==null)?"unknown":crawlingStart);
- prop.put("mode_title",(title==null)?"unknown":title);
+ String escapedURL = (crawlingStart==null)?"unknown":crawlingStart.replaceAll("&","&amp;")
+ .replaceAll("<", "&lt;")
+ .replaceAll(">", "&gt;")
+ .replaceAll("\"", "&quot;");
+
+ prop.put("mode_url",escapedURL);
+ prop.put("mode_title",escapedTitle);
if (crawlingStart != null) {
crawlingStart = crawlingStart.trim();