WordPress.org

Make WordPress Core

Ticket #24280: 24280.patch

File 24280.patch, 1.1 KB (added by chriscct7, 6 years ago)
  • wp-includes/class-wp-xmlrpc-server.php

     
    11791179                        if ( $post_data['post_type'] != get_post_type( $post_data['ID'] ) )
    11801180                                return new IXR_Error( 401, __( 'The post type may not be changed.' ) );
    11811181                } else {
    1182                         if ( ! current_user_can( $post_type->cap->create_posts ) || ! current_user_can( $post_type->cap->edit_posts ) )
     1182                        if ( ! current_user_can( $post_type->cap->create_posts ) && ! current_user_can( $post_type->cap->edit_posts ) )
    11831183                                return new IXR_Error( 401, __( 'Sorry, you are not allowed to post on this site.' ) );
    11841184                }
    11851185
     
    56475647                if ( ! $postdata )
    56485648                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    56495649
    5650                 if ( !current_user_can('publish_posts') || !current_user_can('edit_post', $post_ID) )
     5650                if ( !current_user_can('publish_posts') && !current_user_can('edit_post', $post_ID) )
    56515651                        return new IXR_Error(401, __('Sorry, you cannot publish this post.'));
    56525652
    56535653                $postdata['post_status'] = 'publish';