Skip to content

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

This changes eliminate a way to cripple Profile pages on other peers by sending special messages with HTML tags.

low01224d77b892fc6
diff --git a/htroot/EditProfile_p.java b/htroot/EditProfile_p.java
index 06e6b0a8e..e327e3c18 100644
--- a/htroot/EditProfile_p.java
+++ b/htroot/EditProfile_p.java
@@ -6,7 +6,7 @@
//Frankfurt, Germany, 2004, 2005
//
//This File is contributed by Alexander Schier
-//last change: 27.02.2005
+//last change: 29.06.2005 by Marc Nause
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
@@ -54,6 +54,7 @@ import java.util.Properties;
import de.anomic.http.httpHeader;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
+import de.anomic.tools.unHtml;
public class EditProfile_p {
@@ -69,7 +70,7 @@ public class EditProfile_p {
} finally {
if (fileIn != null) try { fileIn.close(); } catch (Exception e) {}
}
-
+
if(post != null && post.containsKey("set")){
profile.setProperty("name", (String)post.get("name"));
profile.setProperty("nickname", (String)post.get("nickname"));
@@ -83,18 +84,18 @@ public class EditProfile_p {
profile.setProperty("comment", (String)post.get("comment"));
}
- prop.put("name", profile.getProperty("name", ""));
- prop.put("nickname", profile.getProperty("nickname", ""));
- prop.put("homepage", profile.getProperty("homepage", ""));
- prop.put("email", profile.getProperty("email", ""));
-
- prop.put("icq", profile.getProperty("icq", ""));
- prop.put("jabber", profile.getProperty("jabber", ""));
- prop.put("yahoo", profile.getProperty("yahoo", ""));
- prop.put("msn", profile.getProperty("msn", ""));
+ prop.put("name", (new unHtml(profile.getProperty("name", ""))).un());
+ prop.put("nickname", (new unHtml(profile.getProperty("nickname", ""))).un());
+ prop.put("homepage", (new unHtml(profile.getProperty("homepage", ""))).un());
+ prop.put("email", (new unHtml(profile.getProperty("email", ""))).un());
- prop.put("comment", profile.getProperty("comment", ""));
+ prop.put("icq", (new unHtml(profile.getProperty("icq", ""))).un());
+ prop.put("jabber", (new unHtml(profile.getProperty("jabber", ""))).un());
+ prop.put("yahoo", (new unHtml(profile.getProperty("yahoo", ""))).un());
+ prop.put("msn", (new unHtml(profile.getProperty("msn", ""))).un());
+ prop.put("comment", (new unHtml(profile.getProperty("comment", ""))).un());
+
FileOutputStream fileOut = null;
try{
fileOut = new FileOutputStream(new File("DATA/SETTINGS/profile.txt"));
diff --git a/htroot/ViewProfile.java b/htroot/ViewProfile.java
index 17070bfa0..d8efdb890 100644
--- a/htroot/ViewProfile.java
+++ b/htroot/ViewProfile.java
@@ -6,7 +6,7 @@
// Frankfurt, Germany, 2004, 2005
//
// This File is contributed by Alexander Schier
-// last change: 27.02.2005
+// last change: 29.06.2005 by Marc Nause
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -57,6 +57,7 @@ import de.anomic.server.serverSwitch;
import de.anomic.yacy.yacyClient;
import de.anomic.yacy.yacyCore;
import de.anomic.yacy.yacySeed;
+import de.anomic.tools.unHtml;
public class ViewProfile {
@@ -104,7 +105,7 @@ public class ViewProfile {
while (i.hasNext()) {
entry = (Map.Entry) i.next();
String key=(String)entry.getKey();
- String value=((String)entry.getValue()).replaceAll("\r","").replaceAll("\\\\n","\n");
+ String value=(new unHtml(((String)entry.getValue()).replaceAll("\r","").replaceAll("\\\\n","\n"))).un();
//all known Keys which should be set as they are
if(knownKeys.contains(key)){
prop.put("success_"+key, 1);