From 08e24557e2158e3954abb6675fd9c7af62c5ea98 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sun, 13 Apr 2025 15:45:17 +0200 Subject: [PATCH] limit comment name and content length --- comments.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/comments.sh b/comments.sh index 90fdbb9..88791da 100755 --- a/comments.sh +++ b/comments.sh @@ -61,12 +61,12 @@ comments_updatecomment() { [ "$REQUEST_METHOD" = POST ] && case "$(POST action)" in postcomment) comments_postcomment \ "$(POST cuid |checkid)" \ - "$(POST username |grep -m1 -oE '[^[:space:]].*[^[:space:]]')" \ - "$(POST text)";; + "$(POST username |grep -m1 -oE '[^[:space:]].{0,126}[^[:space:]]')" \ + "$(POST text |dd status=none bs=2048 count=1)";; updatecomment) comments_updatecomment \ "$(POST cuid |checkid)" "$(POST updatekey)" \ - "$(POST username |grep -m1 -oE '[^[:space:]].*[^[:space:]]')" \ - "$(POST text)";; + "$(POST username |grep -m1 -oE '[^[:space:]].{0,126}[^[:space:]]')" \ + "$(POST text |dd status=none bs=2048 count=1)";; cancelcommentpost) REDIRECT "${_BASE}${PATH_INFO}#comments";; cancelcommentedit) REDIRECT "${_BASE}${PATH_INFO}#comment_$(POST cuid |checkid)";; esac -- 2.39.5