Commit f765fbdc16 for wordpress.org
commit f765fbdc1600e863e8b3d883227520ea68b6deb0
Author: Weston Ruter <weston@xwp.co>
Date: Sun Nov 23 05:50:26 2025 +0000
Docs: Cast header values to strings in `WP_REST_Comments_Controller::get_items()`.
Follow-up to [38832].
Props justlevine, johnbillion.
See #64238.
Built from https://develop.svn.wordpress.org/trunk@61282
git-svn-id: http://core.svn.wordpress.org/trunk@60594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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 c96a3fe0dd..3f83504f8a 100644
--- a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
+++ b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
@@ -357,8 +357,8 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
}
$response = $is_head_request ? new WP_REST_Response( array() ) : rest_ensure_response( $comments );
- $response->header( 'X-WP-Total', $total_comments );
- $response->header( 'X-WP-TotalPages', $max_pages );
+ $response->header( 'X-WP-Total', (string) $total_comments );
+ $response->header( 'X-WP-TotalPages', (string) $max_pages );
$base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 3a9857a4ac..ea073d2c41 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.0-alpha-61281';
+$wp_version = '7.0-alpha-61282';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.