From d5284f3a3444708b26625d4c993847f9b731942c Mon Sep 17 00:00:00 2001 From: discomrade Date: Fri, 28 Jan 2022 02:25:35 -0100 Subject: [PATCH] Limit maximum email length to 30 to prevent database error --- post.php | 2 +- templates/mod/edit_post_form.html | 2 +- templates/post_form.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/post.php b/post.php index b79880ed..3a313b81 100644 --- a/post.php +++ b/post.php @@ -762,7 +762,7 @@ if (isset($_POST['delete'])) { // Check string lengths if (mb_strlen($post['name']) > 35) error(sprintf($config['error']['toolong'], 'name')); - if (mb_strlen($post['email']) > 40) + if (mb_strlen($post['email']) > 30) error(sprintf($config['error']['toolong'], 'email')); if (mb_strlen($post['subject']) > 100) error(sprintf($config['error']['toolong'], 'subject')); diff --git a/templates/mod/edit_post_form.html b/templates/mod/edit_post_form.html index 7f8d4b1e..6ea595b8 100644 --- a/templates/mod/edit_post_form.html +++ b/templates/mod/edit_post_form.html @@ -15,7 +15,7 @@ {% trans %}Email{% endtrans %} - + diff --git a/templates/post_form.html b/templates/post_form.html index 1f391a69..81d922ba 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -32,7 +32,7 @@ {% if not config.always_noko %}{% endif %} {% else %} - + {% endif %} {{ antibot.html() }} {% if not (not (config.field_disable_subject or (id and config.field_disable_reply_subject)) or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri))) %}