From cf7f96c0adf69e2073953ba223a9769ab8426669 Mon Sep 17 00:00:00 2001 From: vholmes Date: Wed, 15 Feb 2017 23:07:50 -0200 Subject: [PATCH] Prevents reports with too many characters --- inc/config.php | 1 + post.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/inc/config.php b/inc/config.php index 9190d233..7feb86da 100644 --- a/inc/config.php +++ b/inc/config.php @@ -1151,6 +1151,7 @@ $config['error']['nodelete'] = _('You didn\'t select anything to delete.'); $config['error']['nodeletethread'] = _('You are not allowed to delete threads.'); $config['error']['noreport'] = _('You didn\'t select anything to report.'); + $config['error']['invalidreport'] = _('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.'); diff --git a/post.php b/post.php index 38270c17..1388a821 100644 --- a/post.php +++ b/post.php @@ -319,6 +319,9 @@ function handle_report(){ if (empty($report)) error($config['error']['noreport']); + if (strlen($report) > 30) + error($config['error']['invalidreport']); + if (count($report) > $config['report_limit']) error($config['error']['toomanyreports']);