From a58adaafffb883c57593c8cde8843d92120a21e5 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Mon, 25 Jun 2007 21:30:18 +0000 Subject: [PATCH] get_comment_to_edit() should return false when the comment does not exist or is marked as spam. props Westi. fixes #4533. git-svn-id: https://develop.svn.wordpress.org/trunk@5757 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/comment.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/comment.php b/wp-admin/includes/comment.php index b731624d08..7171d31b5a 100644 --- a/wp-admin/includes/comment.php +++ b/wp-admin/includes/comment.php @@ -41,7 +41,8 @@ function edit_comment() { } function get_comment_to_edit( $id ) { - $comment = get_comment( $id ); + if ( !$comment = get_comment($id) ) + return false; $comment->comment_ID = (int) $comment->comment_ID; $comment->comment_post_ID = (int) $comment->comment_post_ID;