WordPress.org

Make WordPress Core

Ticket #45611: 45611.diff

File 45611.diff, 734 bytes (added by dlh, 3 years ago)
  • src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

    diff --git src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
    index 2612f66c9f..fb8ae3ebaa 100644
    class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { 
    717717                        return true;
    718718                }
    719719
    720                 return parent::validate_user_can_query_private_statuses( $value, $request, $parameter );
     720                $valid = parent::sanitize_post_statuses( $value, $request, $parameter );
     721
     722                if ( is_wp_error( $valid ) ) {
     723                        return $valid;
     724                }
     725
     726                return true;
    721727        }
    722728
    723729        /**