From f8a7a22beef60ea4d7af89f9a6205af6a533d361 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Wed, 11 Sep 2024 15:40:17 +0000 Subject: [PATCH] Comments: Ensure `$comment_id` parameter on `get_edit_comment_link` filter is always a comment ID. Follow up to [58875]. Props david.binda, peterwilsoncc, mukesh27, davidbaumwald. Fixes #61727. Built from https://develop.svn.wordpress.org/trunk@59012 git-svn-id: http://core.svn.wordpress.org/trunk@58408 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 9 ++++++--- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 4cfc47f83e..99d6d52912 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -1618,14 +1618,17 @@ function get_edit_comment_link( $comment_id = 0, $context = 'display' ) { $location = admin_url( $action ) . $comment->comment_ID; + // Ensure the $comment_id variable passed to the filter is always an ID. + $comment_id = (int) $comment->comment_ID; + /** * Filters the comment edit link. * * @since 6.7.0 The $comment_id and $context parameters are now being passed to the filter. * - * @param string $location The edit link. - * @param int $comment_id Optional. Unique ID of the comment to generate an edit link. - * @param int $context Optional. Context to include HTML entities in link. Default 'display'. + * @param string $location The edit link. + * @param int $comment_id Unique ID of the comment to generate an edit link. + * @param string $context Context to include HTML entities in link. Default 'display'. */ return apply_filters( 'get_edit_comment_link', $location, $comment_id, $context ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 3d19edc6d7..3acc53fd8f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-59011'; +$wp_version = '6.7-alpha-59012'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.