Coding Standards: Use strict comparison in wp_check_comment_data().

Follow-up to [2894], [28437], [59319].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59975


git-svn-id: http://core.svn.wordpress.org/trunk@59317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2025-03-11 21:58:24 +00:00
parent cc2320237a
commit d857f68a25
2 changed files with 3 additions and 3 deletions

View File

@@ -1287,7 +1287,7 @@ function wp_check_comment_data( $comment_data ) {
if ( ! empty( $comment_data['user_id'] ) ) {
$user = get_userdata( $comment_data['user_id'] );
$post_author = $wpdb->get_var(
$post_author = (int) $wpdb->get_var(
$wpdb->prepare(
"SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1",
$comment_data['comment_post_ID']
@@ -1295,7 +1295,7 @@ function wp_check_comment_data( $comment_data ) {
);
}
if ( isset( $user ) && ( $comment_data['user_id'] == $post_author || $user->has_cap( 'moderate_comments' ) ) ) {
if ( isset( $user ) && ( $comment_data['user_id'] === $post_author || $user->has_cap( 'moderate_comments' ) ) ) {
// The author and the admins get respect.
$approved = 1;
} else {

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.8-beta2-59973';
$wp_version = '6.8-beta2-59975';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.