Browse Source

Limit maximum email length to 30 to prevent database error

main
discomrade 2 years ago
parent
commit
d5284f3a34
  1. 2
      post.php
  2. 2
      templates/mod/edit_post_form.html
  3. 2
      templates/post_form.html

2
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'));

2
templates/mod/edit_post_form.html

@ -15,7 +15,7 @@
{% trans %}Email{% endtrans %}
</th>
<td>
<input type="text" name="email" size="25" maxlength="40" autocomplete="off" value="{{ post.email }}">
<input type="text" name="email" size="25" maxlength="30" autocomplete="off" value="{{ post.email }}">
</td>
</tr>
<tr>

2
templates/post_form.html

@ -32,7 +32,7 @@
{% if not config.always_noko %}<option value="noko">noko</option>{% endif %}
</select>
{% else %}
<input type="text" name="email" size="25" maxlength="40" autocomplete="off">
<input type="text" name="email" size="25" maxlength="30" autocomplete="off">
{% 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))) %}

Loading…
Cancel
Save