Make WordPress Core


Ignore:
Timestamp:
01/28/2025 10:43:54 PM (10 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp_xmlrpc_server::mw_editPost().

Follow-up to [5281], [19914], [31983].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r59713 r59723  
    57915791
    57925792        // Thwart attempt to change the post type.
    5793         if ( ! empty( $content_struct['post_type'] ) && ( $content_struct['post_type'] != $postdata['post_type'] ) ) {
     5793        if ( ! empty( $content_struct['post_type'] ) && ( $content_struct['post_type'] !== $postdata['post_type'] ) ) {
    57945794            return new IXR_Error( 401, __( 'The post type may not be changed.' ) );
    57955795        }
     
    58445844        $post_author = $postdata['post_author'];
    58455845
    5846         // If an author id was provided then use it instead.
     5846        // If an author ID was provided then use it instead.
    58475847        if ( isset( $content_struct['wp_author_id'] ) ) {
    58485848            // Check permissions if attempting to switch author to or from another user.
    5849             if ( $user->ID != $content_struct['wp_author_id'] || $user->ID != $post_author ) {
     5849            if ( $user->ID !== (int) $content_struct['wp_author_id'] || $user->ID !== (int) $post_author ) {
    58505850                switch ( $post_type ) {
    58515851                    case 'post':
Note: See TracChangeset for help on using the changeset viewer.