From 30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 09:57:26 +0200 Subject: Adding upstream version 6.5+dfsg1. Signed-off-by: Daniel Baumann --- wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php') 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 9b38470..c2e0db8 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php @@ -348,7 +348,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller { // Store pagination values for headers then unset for count query. $per_page = (int) $prepared_args['number']; - $page = ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 ); + $page = (int) ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 ); $prepared_args['fields'] = 'ID'; @@ -363,9 +363,9 @@ class WP_REST_Users_Controller extends WP_REST_Controller { $response->header( 'X-WP-Total', (int) $total_users ); - $max_pages = ceil( $total_users / $per_page ); + $max_pages = (int) ceil( $total_users / $per_page ); - $response->header( 'X-WP-TotalPages', (int) $max_pages ); + $response->header( 'X-WP-TotalPages', $max_pages ); $base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) ); if ( $page > 1 ) { -- cgit v1.2.3