[comment] handle people posting junk

This commit is contained in:
Shish 2024-02-05 13:27:40 +00:00
parent 92577d355f
commit 5d9090cd52

View file

@ -255,7 +255,7 @@ class CommentListTheme extends Themelet
$h_del = "";
if ($user->can(Permissions::DELETE_COMMENT)) {
$comment_preview = substr(html_unescape($tfe->stripped), 0, 50);
$j_delete_confirm_message = json_encode_ex("Delete comment by {$comment->owner_name}:\n$comment_preview");
$j_delete_confirm_message = json_encode("Delete comment by {$comment->owner_name}:\n$comment_preview") ?: "Delete <corrupt comment>";
$h_delete_script = html_escape("return confirm($j_delete_confirm_message);");
$h_delete_link = make_link("comment/delete/$i_comment_id/$i_image_id");
$h_del = " - <a onclick='$h_delete_script' href='$h_delete_link'>Del</a>";