mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-24 07:30:10 +01:00
Merge pull request #572 from vichan-devel/RealAngeleno-patch-4
allow posts to be discarded for containing too many lines
This commit is contained in:
commit
77f4684a6b
@ -495,6 +495,8 @@
|
|||||||
|
|
||||||
// Maximum post body length.
|
// Maximum post body length.
|
||||||
$config['max_body'] = 1800;
|
$config['max_body'] = 1800;
|
||||||
|
// Maximum number of lines allowed in a post.
|
||||||
|
$config['max_lines'] = 100;
|
||||||
// Maximum number of post body lines to show on the index page.
|
// Maximum number of post body lines to show on the index page.
|
||||||
$config['body_truncate'] = 15;
|
$config['body_truncate'] = 15;
|
||||||
// Maximum number of characters to show on the index page.
|
// Maximum number of characters to show on the index page.
|
||||||
@ -1127,6 +1129,7 @@
|
|||||||
$config['error']['toolong'] = _('The %s field was too long.');
|
$config['error']['toolong'] = _('The %s field was too long.');
|
||||||
$config['error']['toolong_body'] = _('The body was too long.');
|
$config['error']['toolong_body'] = _('The body was too long.');
|
||||||
$config['error']['tooshort_body'] = _('The body was too short or empty.');
|
$config['error']['tooshort_body'] = _('The body was too short or empty.');
|
||||||
|
$config['error']['toomanylines'] = _('Your post contains too many lines!');
|
||||||
$config['error']['noimage'] = _('You must upload an image.');
|
$config['error']['noimage'] = _('You must upload an image.');
|
||||||
$config['error']['toomanyimages'] = _('You have attempted to upload too many images!');
|
$config['error']['toomanyimages'] = _('You have attempted to upload too many images!');
|
||||||
$config['error']['nomove'] = _('The server failed to handle your upload.');
|
$config['error']['nomove'] = _('The server failed to handle your upload.');
|
||||||
|
4
post.php
4
post.php
@ -728,8 +728,10 @@ if (isset($_POST['delete'])) {
|
|||||||
error(sprintf($config['error']['toolong'], 'email'));
|
error(sprintf($config['error']['toolong'], 'email'));
|
||||||
if (mb_strlen($post['subject']) > 100)
|
if (mb_strlen($post['subject']) > 100)
|
||||||
error(sprintf($config['error']['toolong'], 'subject'));
|
error(sprintf($config['error']['toolong'], 'subject'));
|
||||||
if (!$mod && mb_strlen($post['body']) > $config['max_body'])
|
if (!$mod && substr_count($post['body']) > $config['max_body'])
|
||||||
error($config['error']['toolong_body']);
|
error($config['error']['toolong_body']);
|
||||||
|
if (!$mod && substr_count($post['body'], "\n") >= $config['max_lines'])
|
||||||
|
error($config['error']['toomanylines']);
|
||||||
if (mb_strlen($post['password']) > 20)
|
if (mb_strlen($post['password']) > 20)
|
||||||
error(sprintf($config['error']['toolong'], 'password'));
|
error(sprintf($config['error']['toolong'], 'password'));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user