1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-24 07:30:10 +01:00

Prevents reports with too many characters

This commit is contained in:
vholmes 2017-02-15 23:07:50 -02:00 committed by Zankaria
parent 3ac86a074a
commit 61cdca7207
2 changed files with 5 additions and 1 deletions

View File

@ -1179,7 +1179,7 @@
$config['error']['toomanycross'] = _('Too many cross-board links; post discarded.'); $config['error']['toomanycross'] = _('Too many cross-board links; post discarded.');
$config['error']['nodelete'] = _('You didn\'t select anything to delete.'); $config['error']['nodelete'] = _('You didn\'t select anything to delete.');
$config['error']['noreport'] = _('You didn\'t select anything to report.'); $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']['toomanyreports'] = _('You can\'t report that many posts at once.');
$config['error']['invalidpassword'] = _('Wrong password…'); $config['error']['invalidpassword'] = _('Wrong password…');
$config['error']['invalidimg'] = _('Invalid image.'); $config['error']['invalidimg'] = _('Invalid image.');

View File

@ -488,6 +488,10 @@ if (isset($_POST['delete'])) {
$reason = escape_markup_modifiers($_POST['reason']); $reason = escape_markup_modifiers($_POST['reason']);
markup($reason); markup($reason);
if (strlen($reason) > 30) {
error($config['error']['toolongreport']);
}
foreach ($report as &$id) { foreach ($report as &$id) {
$query = prepare(sprintf("SELECT `id`, `thread` FROM ``posts_%s`` WHERE `id` = :id", $board['uri'])); $query = prepare(sprintf("SELECT `id`, `thread` FROM ``posts_%s`` WHERE `id` = :id", $board['uri']));
$query->bindValue(':id', $id, PDO::PARAM_INT); $query->bindValue(':id', $id, PDO::PARAM_INT);