X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FCreatePostPage.kt;h=302fdf541eaa3c254fcf0fc0cc210660d4392fe4;hp=8287e130683893a7f08ddef8f5c08b0e5e08b7db;hb=ddc708d5b4cbebb3121fb000f44745f55b786e13;hpb=e3eabbebfe2b3fafe182769d0e3cc19d92979b04 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