/*
- * FreenetSone - WebInterface.java - Copyright © 2010 David Roden
+ * Sone - EditImagePage.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 net.pterodactylus.sone.data.Image;
+import net.pterodactylus.sone.text.TextFilter;
import net.pterodactylus.sone.web.page.FreenetRequest;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
if (image == null) {
throw new RedirectException("invalid.html");
}
- if (!webInterface.getCore().isLocalSone(image.getSone())) {
+ if (!image.getSone().isLocal()) {
throw new RedirectException("noPermission.html");
}
if ("true".equals(request.getHttpRequest().getPartAsStringFailsafe("moveLeft", 4))) {
image.getAlbum().moveImageUp(image);
- } else if ("true".equals(request.getHttpRequest().getPartAsStringFailsafe("moveRight", 4))) {
+ } else if ("true".equals(request.getHttpRequest().getPartAsStringFailsafe("moveRight", 4))) {
image.getAlbum().moveImageDown(image);
} else {
String title = request.getHttpRequest().getPartAsStringFailsafe("title", 100).trim();
templateContext.set("titleMissing", true);
}
image.setTitle(title);
- image.setDescription(description);
+ image.setDescription(TextFilter.filter(request.getHttpRequest().getHeader("host"), description));
}
webInterface.getCore().touchConfiguration();
throw new RedirectException(returnPage);