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


git-svn-id: https://develop.svn.wordpress.org/trunk@45267 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
K. Adam White
2019-04-25 00:07:23 +00:00
parent 4f4f253821
commit 9ec1a46b8a
6 changed files with 6 additions and 6 deletions
@@ -343,7 +343,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
$response->header( 'X-WP-TotalPages', (int) $max_pages );
$request_params = $request->get_query_params();
$base = add_query_arg( $request_params, rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );
$base = add_query_arg( urlencode_deep( $request_params ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );
if ( $page > 1 ) {
$prev_page = $page - 1;