Skip to content

Commit

Permalink
Coding Standards: Use strict comparison in wp-includes/pluggable.php.
Browse files Browse the repository at this point in the history
Follow-up to [3566], [6387], [10437], [11057], [11387], [16208], [16304], [18195], [20410], [26367], [34947].

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


git-svn-id: http://core.svn.wordpress.org/trunk@57383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
SergeyBiryukov committed Mar 26, 2024
1 parent d676def commit 95f1ba7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions wp-includes/pluggable.php
Expand Up @@ -30,7 +30,7 @@ function wp_set_current_user( $id, $name = '' ) {
// If `$id` matches the current user, there is nothing to do.
if ( isset( $current_user )
&& ( $current_user instanceof WP_User )
&& ( $id == $current_user->ID )
&& ( $id === $current_user->ID )
&& ( null !== $id )
) {
return $current_user;
Expand Down Expand Up @@ -617,7 +617,7 @@ function wp_authenticate( $username, $password ) {
*/
$user = apply_filters( 'authenticate', null, $username, $password );

if ( null == $user ) {
if ( null === $user ) {
/*
* TODO: What should the error message be? (Or would these even happen?)
* Only needed if all authentication handlers fail to return anything.
Expand Down Expand Up @@ -1093,7 +1093,7 @@ function wp_set_auth_cookie( $user_id, $remember = false, $secure = '', $token =
setcookie( $auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure, true );
setcookie( $auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true );
setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true );
if ( COOKIEPATH != SITECOOKIEPATH ) {
if ( COOKIEPATH !== SITECOOKIEPATH ) {
setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true );
}
}
Expand Down Expand Up @@ -1315,7 +1315,7 @@ function check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) {
* False if the nonce is invalid.
*/
function check_ajax_referer( $action = -1, $query_arg = false, $stop = true ) {
if ( -1 == $action ) {
if ( -1 === $action ) {
_doing_it_wrong( __FUNCTION__, __( 'You should specify an action to be verified by using the first parameter.' ), '4.7.0' );
}

Expand Down Expand Up @@ -1698,12 +1698,12 @@ function wp_notify_postauthor( $comment_id, $deprecated = null ) {
$notify_author = apply_filters( 'comment_notification_notify_author', false, $comment->comment_ID );

// The comment was left by the author.
if ( $author && ! $notify_author && $comment->user_id == $post->post_author ) {
if ( $author && ! $notify_author && (int) $comment->user_id === (int) $post->post_author ) {
unset( $emails[ $author->user_email ] );
}

// The author moderated a comment on their own post.
if ( $author && ! $notify_author && get_current_user_id() == $post->post_author ) {
if ( $author && ! $notify_author && get_current_user_id() === (int) $post->post_author ) {
unset( $emails[ $author->user_email ] );
}

Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Expand Up @@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-alpha-57881';
$wp_version = '6.6-alpha-57882';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit 95f1ba7

Please sign in to comment.