X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FCreateAlbumPage.java;h=9072ea48b192a4b850ca42dc186ad98c83cb9007;hp=53822536d16a757d9445bb857059f874e0cceb32;hb=c9e306ac8e3ada846e87a0cc256a20fc148f381c;hpb=cb93f0ea4a4e9bf12a313a4465ea3cbc061845f3 diff --git a/src/main/java/net/pterodactylus/sone/web/CreateAlbumPage.java b/src/main/java/net/pterodactylus/sone/web/CreateAlbumPage.java index 5382253..9072ea4 100644 --- a/src/main/java/net/pterodactylus/sone/web/CreateAlbumPage.java +++ b/src/main/java/net/pterodactylus/sone/web/CreateAlbumPage.java @@ -19,9 +19,11 @@ package net.pterodactylus.sone.web; import net.pterodactylus.sone.data.Album; import net.pterodactylus.sone.data.Sone; -import net.pterodactylus.sone.web.page.Page.Request.Method; +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; +import net.pterodactylus.util.web.Method; /** * Page that lets the user create a new album. @@ -50,7 +52,7 @@ public class CreateAlbumPage extends SoneTemplatePage { * {@inheritDoc} */ @Override - protected void processTemplate(Request request, TemplateContext templateContext) throws RedirectException { + protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException { super.processTemplate(request, templateContext); if (request.getMethod() == Method.POST) { String name = request.getHttpRequest().getPartAsStringFailsafe("name", 64).trim(); @@ -63,8 +65,8 @@ public class CreateAlbumPage extends SoneTemplatePage { String parentId = request.getHttpRequest().getPartAsStringFailsafe("parent", 36); Album parent = webInterface.getCore().getAlbum(parentId, false); Album album = webInterface.getCore().createAlbum(currentSone, parent); - album.setName(name).setDescription(description); - webInterface.getCore().saveSone(currentSone); + album.setTitle(name).setDescription(TextFilter.filter(request.getHttpRequest().getHeader("host"), description)); + webInterface.getCore().touchConfiguration(); throw new RedirectException("imageBrowser.html?album=" + album.getId()); } }