diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
index f673450d41..8fafc20e80 100644
|
a
|
b
|
class WP_REST_Comments_Controller extends WP_REST_Controller { |
| 285 | 285 | $response->header( 'X-WP-Total', $total_comments ); |
| 286 | 286 | $response->header( 'X-WP-TotalPages', $max_pages ); |
| 287 | 287 | |
| 288 | | $base = add_query_arg( $request->get_query_params(), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) ); |
| | 288 | $base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) ); |
| 289 | 289 | |
| 290 | 290 | if ( $request['page'] > 1 ) { |
| 291 | 291 | $prev_page = $request['page'] - 1; |
diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
index bc0a179f7f..0fb836d249 100644
|
a
|
b
|
class WP_REST_Posts_Controller extends WP_REST_Controller { |
| 343 | 343 | $response->header( 'X-WP-TotalPages', (int) $max_pages ); |
| 344 | 344 | |
| 345 | 345 | $request_params = $request->get_query_params(); |
| 346 | | $base = add_query_arg( $request_params, rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) ); |
| | 346 | $base = add_query_arg( urlencode_deep( $request_params ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) ); |
| 347 | 347 | |
| 348 | 348 | if ( $page > 1 ) { |
| 349 | 349 | $prev_page = $page - 1; |
diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
index 5bdbb73df0..52df0f2206 100644
|
a
|
b
|
class WP_REST_Revisions_Controller extends WP_REST_Controller { |
| 301 | 301 | $response->header( 'X-WP-TotalPages', (int) $max_pages ); |
| 302 | 302 | |
| 303 | 303 | $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 ) ) ); |
| 305 | 305 | |
| 306 | 306 | if ( $page > 1 ) { |
| 307 | 307 | $prev_page = $page - 1; |
diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php
index 8aaf9c6476..299029b1c3 100644
|
a
|
b
|
class WP_REST_Search_Controller extends WP_REST_Controller { |
| 155 | 155 | $response->header( 'X-WP-TotalPages', $max_pages ); |
| 156 | 156 | |
| 157 | 157 | $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 ) ) ); |
| 159 | 159 | |
| 160 | 160 | if ( $page > 1 ) { |
| 161 | 161 | $prev_link = add_query_arg( 'page', $page - 1, $base ); |
diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
index ff399cc60e..fafb74c083 100644
|
a
|
b
|
class WP_REST_Terms_Controller extends WP_REST_Controller { |
| 282 | 282 | |
| 283 | 283 | $response->header( 'X-WP-TotalPages', (int) $max_pages ); |
| 284 | 284 | |
| 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 ) ); |
| 286 | 286 | if ( $page > 1 ) { |
| 287 | 287 | $prev_page = $page - 1; |
| 288 | 288 | |
diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
index 207198e54c..8aab4ca5ad 100644
|
a
|
b
|
class WP_REST_Users_Controller extends WP_REST_Controller { |
| 329 | 329 | |
| 330 | 330 | $response->header( 'X-WP-TotalPages', (int) $max_pages ); |
| 331 | 331 | |
| 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 ) ) ); |
| 333 | 333 | if ( $page > 1 ) { |
| 334 | 334 | $prev_page = $page - 1; |
| 335 | 335 | |