Make WordPress Core


Ignore:
Timestamp:
10/29/2020 06:41:43 PM (4 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.3 branch.

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

Location:
branches/5.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.3

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

    r46865 r49393  
    38743874        }
    38753875
     3876        if (
     3877            'publish' === get_post_status( $post_id ) &&
     3878            ! current_user_can( 'edit_post', $post_id ) &&
     3879            post_password_required( $post_id )
     3880        ) {
     3881            return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) );
     3882        }
     3883
     3884        if (
     3885            'private' === get_post_status( $post_id ) &&
     3886            ! current_user_can( 'read_post', $post_id )
     3887        ) {
     3888            return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) );
     3889        }
     3890
    38763891        $comment = array(
    38773892            'comment_post_ID' => $post_id,
     
    42874302
    42884303        $attachment = get_post( $attachment_id );
    4289         if ( ! $attachment ) {
     4304        if ( ! $attachment || 'attachment' !== $attachment->post_type ) {
    42904305            return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
    42914306        }
Note: See TracChangeset for help on using the changeset viewer.