fix for profile

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3231 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 18 years ago
parent 02522ed607
commit e1fb3550ab

@ -164,19 +164,22 @@ public class ViewProfile {
String key = ((String) entry.getKey());
String value = new String();
// only comments get "wikified"
// this prevents broken links ending in <br>
if (key.equals("comment")) {
value = wikiTransformer.transform(((String) entry.getValue()).replaceAll("\r", "").replaceAll("\\\\n", "\n"));
} else { // else only HTML tags get transformed to regular text
value = wikiCode.replaceHTML(((String) entry.getValue()).replaceAll("\r", "").replaceAll("\\\\n", "\n"));
}
value=((String) entry.getValue()).replaceAll("\r", "").replaceAll("\\\\n", "\n");
//all known Keys which should be set as they are
if (knownKeys.contains(key)) {
if (value.length() > 0) {
prop.put("success_" + key, 1);
prop.put("success_" + key + "_value", value);
// only comments get "wikified"
if(key.equals("comment")){
prop.putASIS(
"success_" + key + "_value",
wikiTransformer.transform(((String) entry.getValue()).replaceAll("\r", "").replaceAll("\\\\n", "\n"))
);
}else{
prop.put("success_" + key + "_value", value); //put replaces HTML Chars by entities.
}
}
//special handling, hide flower if no icq uin is set
} else if (key.equals("homepage")) {

@ -106,7 +106,7 @@ public class serverObjects extends Hashtable implements Cloneable {
// byte[] variant
public byte[] put(String key, byte[] value) {
return (byte[]) this.put((Object) key, (Object) value);
return (byte[]) this.put((Object) key, (Object) value); //TODO: use wikiCode.replaceXMLEntities?!
}
// string variant
@ -114,6 +114,9 @@ public class serverObjects extends Hashtable implements Cloneable {
//return putASIS(key, value);
return (String)putSafeXML(key, value); //XSS Safe!
}
public byte[] putASIS(String key, byte[] value) {
return (byte[]) this.put((Object) key, (Object) value);
}
public String putASIS(Object key, String value) {
return (String) this.put(key, (Object) value);
}
@ -221,4 +224,4 @@ public class serverObjects extends Hashtable implements Cloneable {
return super.clone();
}
}
}

Loading…
Cancel
Save