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

    r44107 r45267  
    156156
    157157        $request_params = $request->get_query_params();
    158         $base           = add_query_arg( $request_params, rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );
     158        $base           = add_query_arg( urlencode_deep( $request_params ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );
    159159
    160160        if ( $page > 1 ) {
Note: See TracChangeset for help on using the changeset viewer.