X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FCreatePostPage.kt;h=302fdf541eaa3c254fcf0fc0cc210660d4392fe4;hb=9acbc5bdec4ccb752e0856a501568b0bb6161579;hp=8287e130683893a7f08ddef8f5c08b0e5e08b7db;hpb=0136315a9aeb2e583326721e103b1690d0e42fc3;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/web/CreatePostPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/CreatePostPage.kt index 8287e13..302fdf5 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/CreatePostPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/CreatePostPage.kt @@ -1,10 +1,10 @@ package net.pterodactylus.sone.web import net.pterodactylus.sone.text.TextFilter +import net.pterodactylus.sone.utils.isPOST 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.POST /** * This page lets the user create a new [Post]. @@ -15,7 +15,7 @@ class CreatePostPage(template: Template, webInterface: WebInterface): override fun handleRequest(request: FreenetRequest, templateContext: TemplateContext) { val returnPage = request.httpRequest.getPartAsStringFailsafe("returnPage", 256) templateContext["returnPage"] = returnPage - if (request.method == POST) { + if (request.isPOST) { val text = request.httpRequest.getPartAsStringFailsafe("text", 65536).trim() if (text == "") { templateContext["errorTextEmpty"] = true