Fix 387ebe9c0c , extract limit to variable

This commit is contained in:
discomrade 2021-07-12 04:04:59 -02:00
parent e2c769cb0f
commit 1c0d712bc8
3 changed files with 6 additions and 3 deletions

View File

@ -900,6 +900,9 @@
// Number of reports you can create at once.
$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.
$config['allow_subtitle_html'] = false;

View File

@ -319,8 +319,8 @@ function handle_report(){
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']['reporttoolong']);
if (count($report) > $config['report_limit'])
error($config['error']['toomanyreports']);

View File

@ -10,7 +10,7 @@
<div id="report-fields">
<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 %}" />
</div>
</div>