From 49b5fb75a64e9f60a6c246838c4c2360d1cab9d5 Mon Sep 17 00:00:00 2001 From: discomrade Date: Mon, 12 Jul 2021 04:04:59 -0200 Subject: [PATCH] Fix https://github.com/vichan-devel/vichan/commit/387ebe9c0c211867a3037b9fb0756ea4db6c32bb for reports, extract limit to variable, give more descriptive error name --- inc/config.php | 5 ++++- post.php | 6 +++--- templates/report.html | 2 +- templates/report_delete.html | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/inc/config.php b/inc/config.php index c4d6c380..c5f68100 100644 --- a/inc/config.php +++ b/inc/config.php @@ -953,6 +953,9 @@ // Number of reports you can create at once. $config['report_limit'] = 3; + // Maximum character length of report. + $config['report_max_length'] = 100; + // Allow unfiltered HTML in board subtitle. This is useful for placing icons and links. $config['allow_subtitle_html'] = false; @@ -1246,7 +1249,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.'); diff --git a/post.php b/post.php index cda3fecc..f504778a 100644 --- a/post.php +++ b/post.php @@ -311,9 +311,9 @@ if (isset($_POST['delete'])) { if (empty($report)) error($config['error']['noreport']); - if (strlen($report) > 30) - error($config['error']['invalidreport']); - + if (strlen($_POST['reason']) > $config['report_max_length']) + error($config['error']['toolongreport']); + if (count($report) > $config['report_limit']) error($config['error']['toomanyreports']); diff --git a/templates/report.html b/templates/report.html index b34f7430..13275415 100644 --- a/templates/report.html +++ b/templates/report.html @@ -11,7 +11,7 @@

Attention!

This form is only for reporting child pornography, bot spam and credit card numbers, social security numbers or banking information. DMCA requests and all other deletion requests MUST be sent via email to admin@8chan.co.

8chan is unmoderated and allows posts without collecting ANY information from the poster less the details of their post. Furthermore, all boards on 8chan are user created and not actively monitored by anyone but the board creator.

8chan has a small volunteer staff to handle this queue, please do not waste their time by filling it with nonsense! If you made a report with this tool and the post was not deleted, do not make the report again! Email admin@8chan.co instead. Abuse of the global report system could lead to address blocks against your IP from 8chan.

Again, 8chan's global volunteers do not handle board specific issues. You most likely want to click "Report" instead to reach the creator and volunteers he assigned to this board.

{% endif %}

{% trans %}Enter reason below...{% endtrans %}

- + {% if config.report_captcha %}

{% trans %}To submit your report, please fill out the CAPTCHA below.{% endtrans %}

{{ captcha['html'] }}
diff --git a/templates/report_delete.html b/templates/report_delete.html index e246da9e..3b765941 100644 --- a/templates/report_delete.html +++ b/templates/report_delete.html @@ -10,7 +10,7 @@
- +
\ No newline at end of file