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-terms-controller.php

    r44965 r45267  
    283283        $response->header( 'X-WP-TotalPages', (int) $max_pages );
    284284
    285         $base = add_query_arg( $request->get_query_params(), rest_url( $this->namespace . '/' . $this->rest_base ) );
     285        $base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( $this->namespace . '/' . $this->rest_base ) );
    286286        if ( $page > 1 ) {
    287287            $prev_page = $page - 1;
Note: See TracChangeset for help on using the changeset viewer.