Skip to content

Commit 7475126

Browse files
Coding Standards: Use strict comparison in wp_check_comment_data().
Follow-up to [2894], [28437], [59319]. Props aristath, poena, afercia, SergeyBiryukov. See #62279. git-svn-id: https://develop.svn.wordpress.org/trunk@59975 602fd350-edb4-49c9-b593-d223f7449a82
1 parent ca9f18d commit 7475126

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wp-includes/comment.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,15 +1287,15 @@ function wp_check_comment_data( $comment_data ) {
12871287

12881288
if ( ! empty( $comment_data['user_id'] ) ) {
12891289
$user = get_userdata( $comment_data['user_id'] );
1290-
$post_author = $wpdb->get_var(
1290+
$post_author = (int) $wpdb->get_var(
12911291
$wpdb->prepare(
12921292
"SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1",
12931293
$comment_data['comment_post_ID']
12941294
)
12951295
);
12961296
}
12971297

1298-
if ( isset( $user ) && ( $comment_data['user_id'] == $post_author || $user->has_cap( 'moderate_comments' ) ) ) {
1298+
if ( isset( $user ) && ( $comment_data['user_id'] === $post_author || $user->has_cap( 'moderate_comments' ) ) ) {
12991299
// The author and the admins get respect.
13001300
$approved = 1;
13011301
} else {

0 commit comments

Comments
 (0)