Browse Source
Merge pull request #336 from discomrade/vichan-report-length
vichan downstream: Enforce maximum report length
pull/40/head
nonmakina
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
8 additions and
1 deletions
-
inc/config.php
-
post.php
-
templates/report_delete.html
|
@ -900,6 +900,9 @@ |
|
|
// Number of reports you can create at once. |
|
|
// Number of reports you can create at once. |
|
|
$config['report_limit'] = 3; |
|
|
$config['report_limit'] = 3; |
|
|
|
|
|
|
|
|
|
|
|
// Maximum character length of report. |
|
|
|
|
|
$config['report_max_length'] = 50; |
|
|
|
|
|
|
|
|
// Allow unfiltered HTML in board subtitle. This is useful for placing icons and links. |
|
|
// Allow unfiltered HTML in board subtitle. This is useful for placing icons and links. |
|
|
$config['allow_subtitle_html'] = false; |
|
|
$config['allow_subtitle_html'] = false; |
|
|
|
|
|
|
|
@ -1148,6 +1151,7 @@ |
|
|
$config['error']['nodelete'] = _('You didn\'t select anything to delete.'); |
|
|
$config['error']['nodelete'] = _('You didn\'t select anything to delete.'); |
|
|
$config['error']['nodeletethread'] = _('You are not allowed to delete threads.'); |
|
|
$config['error']['nodeletethread'] = _('You are not allowed to delete threads.'); |
|
|
$config['error']['noreport'] = _('You didn\'t select anything to report.'); |
|
|
$config['error']['noreport'] = _('You didn\'t select anything to report.'); |
|
|
|
|
|
$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.'); |
|
|
|
@ -319,6 +319,9 @@ function handle_report(){ |
|
|
if (empty($report)) |
|
|
if (empty($report)) |
|
|
error($config['error']['noreport']); |
|
|
error($config['error']['noreport']); |
|
|
|
|
|
|
|
|
|
|
|
if (strlen($_POST['reason']) > $config['report_max_length']) |
|
|
|
|
|
error($config['error']['reporttoolong']); |
|
|
|
|
|
|
|
|
if (count($report) > $config['report_limit']) |
|
|
if (count($report) > $config['report_limit']) |
|
|
error($config['error']['toomanyreports']); |
|
|
error($config['error']['toomanyreports']); |
|
|
|
|
|
|
|
|
|
@ -10,7 +10,7 @@ |
|
|
|
|
|
|
|
|
<div id="report-fields"> |
|
|
<div id="report-fields"> |
|
|
<label for="reason">{% trans %}Reason{% endtrans %}</label> |
|
|
<label for="reason">{% trans %}Reason{% endtrans %}</label> |
|
|
<input id="reason" type="text" name="reason" size="20" maxlength="100" /> |
|
|
<input id="reason" type="text" name="reason" size="20" maxlength="{{ config.report_max_length }}" /> |
|
|
<input type="submit" name="report" value="{% trans %}Report{% endtrans %}" /> |
|
|
<input type="submit" name="report" value="{% trans %}Report{% endtrans %}" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|