From 3d86bc9bc32975f398233df46626fb7246abe710 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Sat, 4 Jun 2011 20:18:03 +1000 Subject: bug fix causing reported post controls to be truncated/omitted --- mod.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'mod.php') diff --git a/mod.php b/mod.php index 5f655bcb..a2ebff26 100644 --- a/mod.php +++ b/mod.php @@ -1172,7 +1172,7 @@ $po = new Post($post['id'], $post['thread'], $post['subject'], $post['email'], $post['name'], $post['trip'], $post['capcode'], $post['body'], $post['time'], $post['thumb'], $post['thumbwidth'], $post['thumbheight'], $post['file'], $post['filewidth'], $post['fileheight'], $post['filesize'], $post['filename'], $post['ip'], $post['embed'], '?/', $mod); } - $po->body .= + $append_html = '
' . '
' . 'Board: ' . sprintf($config['board_abbreviation'], $report['uri']) . '
' . @@ -1184,7 +1184,22 @@ ($mod['type'] >= $config['mod']['report_dismiss_ip'] ? 'Dismiss+' : '') . '
'; + + // 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(strlen($po->body) + 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'] = strlen($po->body) + 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; } $query = query("SELECT COUNT(`id`) AS `count` FROM `reports`") or error(db_error()); -- cgit v1.3