diff -r 34716fd837a4 -r be944660c56a wp/wp-admin/comment.php --- a/wp/wp-admin/comment.php Tue Dec 15 15:52:01 2020 +0100 +++ b/wp/wp-admin/comment.php Wed Sep 21 18:19:35 2022 +0200 @@ -36,14 +36,18 @@ } } -$comment_id = absint( $_GET['c'] ); -$comment = get_comment( $comment_id ); +if ( isset( $_REQUEST['c'] ) ) { + $comment_id = absint( $_REQUEST['c'] ); + $comment = get_comment( $comment_id ); -// Prevent actions on a comment associated with a trashed post. -if ( 'trash' === get_post_status( $comment->comment_post_ID ) ) { - wp_die( - __( 'You can’t edit this comment because the associated post is in the Trash. Please restore the post first, then try again.' ) - ); + // Prevent actions on a comment associated with a trashed post. + if ( $comment && 'trash' === get_post_status( $comment->comment_post_ID ) ) { + wp_die( + __( 'You can’t edit this comment because the associated post is in the Trash. Please restore the post first, then try again.' ) + ); + } +} else { + $comment = null; } switch ( $action ) { @@ -163,19 +167,19 @@ - - + + - - + + - - + + @@ -203,17 +207,17 @@ } ?> - - + + - - + + + - -
comment_post_ID ) ) { @@ -222,31 +226,32 @@ echo $submitted; } ?> -
-

comment_ID}" ); ?>">

+

+ comment_ID}" ) ); ?>"> +

+ + -
- +

- +

-
+ - +