Make WordPress Core


Ignore:
Timestamp:
10/29/2020 07:17:08 PM (6 years ago)
Author:
whyisjake
Message:

General: WordPress updates

  • XML-RPC: Improve error messages for unprivileged users.
  • External Libraries: Disable deserialization in Requests_Utility_FilteredIterator
  • Embeds: Disable embeds on deactivated Multisite sites.
  • Coding standards: Modify escaping functions to avoid potential false positives.
  • XML-RPC: Return error message if attachment ID is incorrect.
  • Upgrade/install: Improve logic check when determining installation status.
  • Meta: Sanitize meta key before checking protection status.
  • Themes: Ensure that only privileged users can set a background image when a theme is using the deprecated custom background page.

Brings the changes from [49380,49382-49388] to the 3.7 branch.

Props xknown, zieladam, peterwilsoncc, whyisjake, desrosj, dd32.

Location:
branches/3.7
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.7

  • branches/3.7/src

  • branches/3.7/src/wp-includes/class-wp-xmlrpc-server.php

    r40703 r49409  
    30423042            return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    30433043
     3044        if (
     3045            'publish' === get_post_status( $post_id ) &&
     3046            ! current_user_can( 'edit_post', $post_id ) &&
     3047            post_password_required( $post_id )
     3048        ) {
     3049            return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) );
     3050        }
     3051
     3052        if (
     3053            'private' === get_post_status( $post_id ) &&
     3054            ! current_user_can( 'read_post', $post_id )
     3055        ) {
     3056            return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) );
     3057        }
     3058
     3059        $comment = array();
    30443060        $comment['comment_post_ID'] = $post_id;
    30453061
     
    33503366        do_action('xmlrpc_call', 'wp.getMediaItem');
    33513367
    3352         if ( ! $attachment = get_post($attachment_id) )
     3368        $attachment = get_post( $attachment_id );
     3369        if ( ! $attachment || 'attachment' !== $attachment->post_type ) {
    33533370            return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
     3371        }
    33543372
    33553373        return $this->_prepare_media_item( $attachment );
Note: See TracChangeset for help on using the changeset viewer.