From b1a12f671889b9914729243834f408b97d526350 Mon Sep 17 00:00:00 2001 From: markjaquith 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: http://svn.automattic.com/wordpress/trunk@5757 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 b731624d0..7171d31b5 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;