diff --git a/ext/comment/theme.php b/ext/comment/theme.php index 80b9029c..9cbdc108 100644 --- a/ext/comment/theme.php +++ b/ext/comment/theme.php @@ -209,7 +209,11 @@ class CommentListTheme extends Themelet $i_uid = $comment->owner_id; $h_name = html_escape($comment->owner_name); $h_timestamp = autodate($comment->posted); - $h_comment = ($trim ? truncate($tfe->stripped, 50) : $tfe->formatted); + if ($trim) { + $h_comment = strlen($tfe->stripped) > 52 ? substr($tfe->stripped, 0, 50)."..." : $tfe->stripped; + } else { + $h_comment = $tfe->formatted; + } $i_comment_id = $comment->comment_id; $i_image_id = $comment->image_id; diff --git a/themes/danbooru/comment.theme.php b/themes/danbooru/comment.theme.php index aaa79476..8214b9d9 100644 --- a/themes/danbooru/comment.theme.php +++ b/themes/danbooru/comment.theme.php @@ -103,7 +103,11 @@ class CustomCommentListTheme extends CommentListTheme //$i_uid = $comment->owner_id; $h_name = html_escape($comment->owner_name); //$h_poster_ip = html_escape($comment->poster_ip); - $h_comment = ($trim ? substr($tfe->stripped, 0, 50)."..." : $tfe->formatted); + if ($trim) { + $h_comment = strlen($tfe->stripped) > 52 ? substr($tfe->stripped, 0, 50)."..." : $tfe->stripped; + } else { + $h_comment = $tfe->formatted; + } $i_comment_id = $comment->comment_id; $i_image_id = $comment->image_id; $h_posted = autodate($comment->posted); diff --git a/themes/danbooru2/comment.theme.php b/themes/danbooru2/comment.theme.php index 25e25897..59bd1143 100644 --- a/themes/danbooru2/comment.theme.php +++ b/themes/danbooru2/comment.theme.php @@ -103,7 +103,11 @@ class CustomCommentListTheme extends CommentListTheme //$i_uid = $comment->owner_id; $h_name = html_escape($comment->owner_name); //$h_poster_ip = html_escape($comment->poster_ip); - $h_comment = ($trim ? substr($tfe->stripped, 0, 50)."..." : $tfe->formatted); + if ($trim) { + $h_comment = strlen($tfe->stripped) > 52 ? substr($tfe->stripped, 0, 50)."..." : $tfe->stripped; + } else { + $h_comment = $tfe->formatted; + } $i_comment_id = $comment->comment_id; $i_image_id = $comment->image_id; $h_posted = autodate($comment->posted); diff --git a/themes/futaba/comment.theme.php b/themes/futaba/comment.theme.php index e6ced4d3..0335e032 100644 --- a/themes/futaba/comment.theme.php +++ b/themes/futaba/comment.theme.php @@ -77,7 +77,11 @@ class CustomCommentListTheme extends CommentListTheme //$i_uid = $comment->owner_id; $h_name = html_escape($comment->owner_name); //$h_poster_ip = html_escape($comment->poster_ip); - $h_comment = ($trim ? substr($tfe->stripped, 0, 50)."..." : $tfe->formatted); + if ($trim) { + $h_comment = strlen($tfe->stripped) > 52 ? substr($tfe->stripped, 0, 50)."..." : $tfe->stripped; + } else { + $h_comment = $tfe->formatted; + } $i_comment_id = $comment->comment_id; $i_image_id = $comment->image_id;