Make WordPress Core

Ticket #62903: 62903.diff

File 62903.diff, 1.3 KB (added by donjajo, 2 months ago)
  • src/wp-includes/rest-api/class-wp-rest-server.php

    diff --git a/src/wp-includes/rest-api/class-wp-rest-server.php b/src/wp-includes/rest-api/class-wp-rest-server.php
    index 17d620f6fb..34719eb498 100644
    a b class WP_REST_Server { 
    11101110                        );
    11111111                }
    11121112
    1113                 if ( ! is_wp_error( $error ) ) {
    1114                         $check_required = $request->has_valid_params();
    1115                         if ( is_wp_error( $check_required ) ) {
    1116                                 $error = $check_required;
    1117                         } else {
    1118                                 $check_sanitized = $request->sanitize_params();
    1119                                 if ( is_wp_error( $check_sanitized ) ) {
    1120                                         $error = $check_sanitized;
    1121                                 }
    1122                         }
    1123                 }
    1124 
    11251113                $response = $this->respond_to_request( $request, $route, $handler, $error );
    11261114                array_pop( $this->dispatching_requests );
    11271115                return $response;
    class WP_REST_Server { 
    12691257                        }
    12701258                }
    12711259
     1260                if ( ! is_wp_error( $response ) ) {
     1261                        $check_required = $request->has_valid_params();
     1262                        if ( is_wp_error( $check_required ) ) {
     1263                                $response = $check_required;
     1264                        } else {
     1265                                $check_sanitized = $request->sanitize_params();
     1266                                if ( is_wp_error( $check_sanitized ) ) {
     1267                                        $response = $check_sanitized;
     1268                                }
     1269                        }
     1270                }
     1271
    12721272                if ( ! is_wp_error( $response ) ) {
    12731273                        /**
    12741274                         * Filters the REST API dispatch request result.