--- a/wp/wp-admin/comment.php Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-admin/comment.php Fri Sep 05 18:40:08 2025 +0200
@@ -16,7 +16,8 @@
* @global string $action
*/
global $action;
-wp_reset_vars( array( 'action' ) );
+
+$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
if ( isset( $_POST['deletecomment'] ) ) {
$action = 'deletecomment';
@@ -68,8 +69,8 @@
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
- '<p>' . __( '<a href="https://wordpress.org/support/article/comments-screen/">Documentation on Comments</a>' ) . '</p>' .
- '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+ '<p>' . __( '<a href="https://wordpress.org/documentation/article/comments-screen/">Documentation on Comments</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);
wp_enqueue_script( 'comment' );
@@ -161,11 +162,23 @@
break;
}
if ( $message ) {
- echo '<div id="message" class="notice notice-info"><p>' . $message . '</p></div>';
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'info',
+ 'id' => 'message',
+ )
+ );
}
}
+ wp_admin_notice(
+ '<strong>' . __( 'Caution:' ) . '</strong> ' . $caution_msg,
+ array(
+ 'type' => 'warning',
+ 'id' => 'message',
+ )
+ );
?>
-<div id="message" class="notice notice-warning"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo $caution_msg; ?></p></div>
<table class="form-table comment-ays">
<tr>
@@ -282,7 +295,7 @@
comment_footer_die( __( 'Sorry, you are not allowed to edit comments on this post.' ) );
}
- if ( wp_get_referer() && ! $noredir && false === strpos( wp_get_referer(), 'comment.php' ) ) {
+ if ( wp_get_referer() && ! $noredir && ! str_contains( wp_get_referer(), 'comment.php' ) ) {
$redir = wp_get_referer();
} elseif ( wp_get_original_referer() && ! $noredir ) {
$redir = wp_get_original_referer();