Browse Source

Add min_body configuration option for post too short check

main
Benjamin Southall 7 years ago
committed by -
parent
commit
6a2ffda7e0
  1. 2
      inc/config.php
  2. 2
      post.php

2
inc/config.php

@ -488,6 +488,8 @@
// Maximum post body length.
$config['max_body'] = 1800;
// Minimum post body length.
$config['min_body'] = 0;
// Maximum number of post body lines to show on the index page.
$config['body_truncate'] = 15;
// Maximum number of characters to show on the index page.

2
post.php

@ -730,6 +730,8 @@ if (isset($_POST['delete'])) {
error(sprintf($config['error']['toolong'], 'subject'));
if (!$mod && mb_strlen($post['body']) > $config['max_body'])
error($config['error']['toolong_body']);
if (!$mod && mb_strlen($post['body']) > 0 && mb_strlen($post['body']) < $config['min_body'])
error($config['error']['tooshort_body']);
if (mb_strlen($post['password']) > 20)
error(sprintf($config['error']['toolong'], 'password'));
}

Loading…
Cancel
Save