From 594afad9db43aaab0c7b387fb9988b67e7f6bd88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 20 Oct 2010 14:49:24 +0200 Subject: [PATCH] Honor return page. --- src/main/java/net/pterodactylus/sone/web/BlockSonePage.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/web/BlockSonePage.java b/src/main/java/net/pterodactylus/sone/web/BlockSonePage.java index afac535..4bde0d1 100644 --- a/src/main/java/net/pterodactylus/sone/web/BlockSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/BlockSonePage.java @@ -49,11 +49,12 @@ public class BlockSonePage extends SoneTemplatePage { @Override protected void processTemplate(Request request, Template template) throws RedirectException { super.processTemplate(request, template); - String soneId = request.getHttpRequest().getPartAsStringFailsafe("sone", 36); if (request.getMethod() == Method.POST) { + String soneId = request.getHttpRequest().getPartAsStringFailsafe("sone", 36); + String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 64); getCurrentSone(request.getToadletContext()).addBlockedSoneId(soneId); + throw new RedirectException(returnPage); } - throw new RedirectException("viewSone.html?sone=" + soneId); } // -- 2.7.4