WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/25/2019 12:07:23 AM (2 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-users-controller.php

    r44641 r45267  
    330330        $response->header( 'X-WP-TotalPages', (int) $max_pages );
    331331
    332         $base = add_query_arg( $request->get_query_params(), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );
     332        $base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );
    333333        if ( $page > 1 ) {
    334334            $prev_page = $page - 1;
Note: See TracChangeset for help on using the changeset viewer.