mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-23 23:20:57 +01:00
Merge pull request #697 from Zankaria/report-limits
Limit the report length
This commit is contained in:
commit
44684496c7
@ -937,6 +937,9 @@
|
||||
// Number of reports you can create at once.
|
||||
$config['report_limit'] = 3;
|
||||
|
||||
// Maximum number of characters per report.
|
||||
$config['report_max_length'] = 30;
|
||||
|
||||
// Allow unfiltered HTML in board subtitle. This is useful for placing icons and links.
|
||||
$config['allow_subtitle_html'] = false;
|
||||
|
||||
@ -1179,7 +1182,7 @@
|
||||
$config['error']['toomanycross'] = _('Too many cross-board links; post discarded.');
|
||||
$config['error']['nodelete'] = _('You didn\'t select anything to delete.');
|
||||
$config['error']['noreport'] = _('You didn\'t select anything to report.');
|
||||
$config['error']['invalidreport'] = _('The reason was too long.');
|
||||
$config['error']['toolongreport'] = _('The reason was too long.');
|
||||
$config['error']['toomanyreports'] = _('You can\'t report that many posts at once.');
|
||||
$config['error']['invalidpassword'] = _('Wrong password…');
|
||||
$config['error']['invalidimg'] = _('Invalid image.');
|
||||
|
4
post.php
4
post.php
@ -488,6 +488,10 @@ if (isset($_POST['delete'])) {
|
||||
$reason = escape_markup_modifiers($_POST['reason']);
|
||||
markup($reason);
|
||||
|
||||
if (mb_strlen($reason) > $config['report_max_length']) {
|
||||
error($config['error']['toolongreport']);
|
||||
}
|
||||
|
||||
foreach ($report as &$id) {
|
||||
$query = prepare(sprintf("SELECT `id`, `thread` FROM ``posts_%s`` WHERE `id` = :id", $board['uri']));
|
||||
$query->bindValue(':id', $id, PDO::PARAM_INT);
|
||||
|
Loading…
Reference in New Issue
Block a user