X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FCreateReplyPage.java;h=420fb86f76fdb0fc92d1a701d08c07ea6836d37b;hb=594afad9db43aaab0c7b387fb9988b67e7f6bd88;hp=e48232e56fa9d0fa9b8751197c0bedaa50789de4;hpb=66f29561ceb5acbf42a4b8319f1c79ccbfba0979;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/CreateReplyPage.java b/src/main/java/net/pterodactylus/sone/web/CreateReplyPage.java index e48232e..420fb86 100644 --- a/src/main/java/net/pterodactylus/sone/web/CreateReplyPage.java +++ b/src/main/java/net/pterodactylus/sone/web/CreateReplyPage.java @@ -50,19 +50,23 @@ public class CreateReplyPage extends SoneTemplatePage { */ @Override protected void processTemplate(Request request, Template template) throws RedirectException { - String postId = request.getHttpRequest().getPartAsStringFailsafe("postId", 36); + super.processTemplate(request, template); + String postId = request.getHttpRequest().getPartAsStringFailsafe("post", 36); String text = request.getHttpRequest().getPartAsStringFailsafe("text", 65536).trim(); + String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 64); + System.out.println("postId: " + postId + ", text: " + text + ", returnPage: " + returnPage); if (request.getMethod() == Method.POST) { Post post = webInterface.core().getPost(postId); if (text.length() > 0) { Sone currentSone = getCurrentSone(request.getToadletContext()); webInterface.core().createReply(currentSone, post, text); - throw new RedirectException("viewPost.html?post=" + post.getId()); + throw new RedirectException(returnPage); } template.set("errorTextEmpty", true); } template.set("postId", postId); template.set("text", text); + template.set("returnPage", returnPage); } //