From e6d188799eaeff566a033e184ee57dca1ee6fa2d Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sun, 31 Aug 2025 15:12:33 +0200 Subject: [PATCH] pages.php: append dismiss buttons after the post, remove horrendous workaround --- inc/mod/pages.php | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 2d5b87ab..477eeec2 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -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, '
')); - - 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) . '
'; - - if (isset($__old_body_truncate_char)) { - $config['body_truncate_char'] = $__old_body_truncate_char; - } + $body .= $report_html . '
'; } $count = \count($report_rows);