Make WordPress Core


Ignore:
Timestamp:
10/29/2020 06:50:55 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 5.0 branch.

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

Location:
branches/5.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0

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

    r43819 r49396  
    36453645                }
    36463646
     3647                if (
     3648                        'publish' === get_post_status( $post_id ) &&
     3649                        ! current_user_can( 'edit_post', $post_id ) &&
     3650                        post_password_required( $post_id )
     3651                ) {
     3652                        return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) );
     3653                }
     3654
     3655                if (
     3656                        'private' === get_post_status( $post_id ) &&
     3657                        ! current_user_can( 'read_post', $post_id )
     3658                ) {
     3659                        return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) );
     3660                }
     3661
    36473662                $comment = array(
    36483663                        'comment_post_ID' => $post_id,
     
    40304045                do_action( 'xmlrpc_call', 'wp.getMediaItem' );
    40314046
    4032                 if ( ! $attachment = get_post($attachment_id) )
     4047                $attachment = get_post( $attachment_id );
     4048                if ( ! $attachment || 'attachment' !== $attachment->post_type ) {
    40334049                        return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
     4050                }
    40344051
    40354052                return $this->_prepare_media_item( $attachment );
Note: See TracChangeset for help on using the changeset viewer.