From 5d4148c10d2ea5df2418868a4b76f7a32560c13d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 28 Jan 2025 22:45:21 +0000 Subject: [PATCH] Coding Standards: Use strict comparison in `wp_xmlrpc_server::mw_editPost()`. Follow-up to [5281], [19914], [31983]. Props aristath, poena, afercia, SergeyBiryukov. See #62279. Built from https://develop.svn.wordpress.org/trunk@59723 git-svn-id: http://core.svn.wordpress.org/trunk@59065 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-xmlrpc-server.php | 6 +++--- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index 2a1815e5aa..93c9333d59 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -5790,7 +5790,7 @@ class wp_xmlrpc_server extends IXR_Server { } // Thwart attempt to change the post type. - if ( ! empty( $content_struct['post_type'] ) && ( $content_struct['post_type'] != $postdata['post_type'] ) ) { + if ( ! empty( $content_struct['post_type'] ) && ( $content_struct['post_type'] !== $postdata['post_type'] ) ) { return new IXR_Error( 401, __( 'The post type may not be changed.' ) ); } @@ -5843,10 +5843,10 @@ class wp_xmlrpc_server extends IXR_Server { $post_author = $postdata['post_author']; - // If an author id was provided then use it instead. + // If an author ID was provided then use it instead. if ( isset( $content_struct['wp_author_id'] ) ) { // Check permissions if attempting to switch author to or from another user. - if ( $user->ID != $content_struct['wp_author_id'] || $user->ID != $post_author ) { + if ( $user->ID !== (int) $content_struct['wp_author_id'] || $user->ID !== (int) $post_author ) { switch ( $post_type ) { case 'post': if ( ! current_user_can( 'edit_others_posts' ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 414ab2cf40..763eea0d47 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59722'; +$wp_version = '6.8-alpha-59723'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.