Merge branch 'release-0.8.8'
[Sone.git] / src / main / java / net / pterodactylus / sone / web / EditProfilePage.java
index 51a72b8..d0ddb26 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - EditProfilePage.java - Copyright © 2010–2012 David Roden
+ * Sone - EditProfilePage.java - Copyright © 2010–2013 David Roden
  *
  * 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
 
 package net.pterodactylus.sone.web;
 
+import static net.pterodactylus.sone.text.TextFilter.filter;
+
 import java.util.List;
 
 import net.pterodactylus.sone.data.Profile;
 import net.pterodactylus.sone.data.Profile.Field;
 import net.pterodactylus.sone.data.Sone;
+import net.pterodactylus.sone.text.TextFilter;
 import net.pterodactylus.sone.web.page.FreenetRequest;
 import net.pterodactylus.util.number.Numbers;
 import net.pterodactylus.util.template.Template;
@@ -85,7 +88,8 @@ public class EditProfilePage extends SoneTemplatePage {
                                profile.setAvatar(webInterface.getCore().getImage(avatarId, false));
                                for (Field field : fields) {
                                        String value = request.getHttpRequest().getPartAsStringFailsafe("field-" + field.getId(), 400);
-                                       field.setValue(value);
+                                       String filteredValue = filter(request.getHttpRequest().getHeader("Host"), value);
+                                       field.setValue(filteredValue);
                                }
                                currentSone.setProfile(profile);
                                webInterface.getCore().touchConfiguration();