Compare commits

...

2 commits

2 changed files with 8 additions and 17 deletions

View file

@ -3007,8 +3007,10 @@ function mod_reports(Context $ctx) {
$po = new Post($post, '?/', $mod);
}
$body .= $po->build(true);
// A little messy and inefficient.
$append_html = Element('mod/report.html', array(
$report_html = Element('mod/report.html', array(
'report' => $report,
'config' => $config,
'mod' => $mod,
@ -3016,22 +3018,7 @@ function mod_reports(Context $ctx) {
'token_all' => make_secure_link_token('reports/' . $report['id'] . '/dismissall')
));
// Bug fix for https://github.com/savetheinternet/Tinyboard/issues/21
$po->body = truncate($po->body, $po->link(), $config['body_truncate'] - substr_count($append_html, '<br>'));
if (\mb_strlen($po->body) + \mb_strlen($append_html) > $config['body_truncate_char']) {
// still too long; temporarily increase limit in the config
$__old_body_truncate_char = $config['body_truncate_char'];
$config['body_truncate_char'] = \mb_strlen($po->body) + \mb_strlen($append_html);
}
$po->body .= $append_html;
$body .= $po->build(true) . '<hr>';
if (isset($__old_body_truncate_char)) {
$config['body_truncate_char'] = $__old_body_truncate_char;
}
$body .= $report_html . '<hr>';
}
$count = \count($report_rows);

View file

@ -808,6 +808,10 @@ hr {
div.report {
color: #333;
margin-left: 1.4em;
padding-right: 3em;
padding-bottom: 0.3em;
white-space: pre-wrap;
}
div.top_notice {