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

    r43584 r45267  
    302302
    303303        $request_params = $request->get_query_params();
    304         $base           = add_query_arg( $request_params, rest_url( sprintf( '%s/%s/%d/%s', $this->namespace, $this->parent_base, $request['parent'], $this->rest_base ) ) );
     304        $base           = add_query_arg( urlencode_deep( $request_params ), rest_url( sprintf( '%s/%s/%d/%s', $this->namespace, $this->parent_base, $request['parent'], $this->rest_base ) ) );
    305305
    306306        if ( $page > 1 ) {
Note: See TracChangeset for help on using the changeset viewer.