Make WordPress Core


Ignore:
Timestamp:
04/25/2019 12:07:23 AM (6 years ago)
Author:
kadamwhite
Message:

REST API: Always urlencode_deep() query args in get_items methods.

Passing all received query arguments through urlencode_deep ensures that the full set of query arguments are encoded in the same way.

Props dmsnell.
Fixes #46199

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

    r45190 r45267  
    344344
    345345        $request_params = $request->get_query_params();
    346         $base           = add_query_arg( $request_params, rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );
     346        $base           = add_query_arg( urlencode_deep( $request_params ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );
    347347
    348348        if ( $page > 1 ) {
Note: See TracChangeset for help on using the changeset viewer.