WordPress.org

Make WordPress Core

Changeset 49376


Ignore:
Timestamp:
10/29/2020 04:57:43 PM (4 months ago)
Author:
whyisjake
Message:

XML-RPC: Return error message if attachment ID is incorrect.

Throw an error for incorrect attachment IDs when requesting a media object to ensure return signature is correct and doesn't include incorrectly typed values within the object.

Props zieladam, peterwilsoncc, whyisjake.
See #49905.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.5/src/wp-includes/class-wp-xmlrpc-server.php

    r49273 r49376  
    42934293
    42944294        $attachment = get_post( $attachment_id );
    4295         if ( ! $attachment ) {
     4295        if ( ! $attachment || 'attachment' !== $attachment->post_type ) {
    42964296            return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
    42974297        }
Note: See TracChangeset for help on using the changeset viewer.