Make WordPress Core


Ignore:
Timestamp:
10/29/2020 06:54:29 PM (5 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 4.8 branch.

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

Location:
branches/4.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.8

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

    r40692 r49398  
    35813581        }
    35823582
     3583        if (
     3584            'publish' === get_post_status( $post_id ) &&
     3585            ! current_user_can( 'edit_post', $post_id ) &&
     3586            post_password_required( $post_id )
     3587        ) {
     3588            return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) );
     3589        }
     3590
     3591        if (
     3592            'private' === get_post_status( $post_id ) &&
     3593            ! current_user_can( 'read_post', $post_id )
     3594        ) {
     3595            return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) );
     3596        }
     3597
    35833598        $comment = array(
    35843599            'comment_post_ID' => $post_id,
     
    39663981        do_action( 'xmlrpc_call', 'wp.getMediaItem' );
    39673982
    3968         if ( ! $attachment = get_post($attachment_id) )
     3983        $attachment = get_post( $attachment_id );
     3984        if ( ! $attachment || 'attachment' !== $attachment->post_type ) {
    39693985            return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
     3986        }
    39703987
    39713988        return $this->_prepare_media_item( $attachment );
Note: See TracChangeset for help on using the changeset viewer.