Honor return page.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 20 Oct 2010 12:49:24 +0000 (14:49 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 20 Oct 2010 12:49:24 +0000 (14:49 +0200)
src/main/java/net/pterodactylus/sone/web/BlockSonePage.java

index afac535..4bde0d1 100644 (file)
@@ -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);
        }
 
        //