From: David ‘Bombe’ Roden Date: Wed, 17 Nov 2010 21:09:11 +0000 (+0100) Subject: Verify post better. X-Git-Tag: 0.3-RC1~6 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=831127ee62043d6ec1780a4a4bc331b5a5693b1b;p=Sone.git Verify post better. --- diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/DeletePostAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/DeletePostAjaxPage.java index d874493..d2a7a39 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/DeletePostAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/DeletePostAjaxPage.java @@ -49,9 +49,9 @@ public class DeletePostAjaxPage extends JsonPage { @Override protected JsonObject createJsonObject(Request request) { String postId = request.getHttpRequest().getParam("post"); - Post post = webInterface.getCore().getPost(postId); + Post post = webInterface.getCore().getPost(postId, false); Sone currentSone = getCurrentSone(request.getToadletContext()); - if (post == null) { + if ((post == null) || (post.getSone() == null)) { return createErrorJsonObject("invalid-post-id"); } if (currentSone == null) {