Make WordPress Core


Ignore:
Timestamp:
11/23/2025 05:48:01 AM (11 months ago)
Author:
westonruter
Message:

Docs: Cast header values to strings in WP_REST_Comments_Controller::get_items().

Follow-up to [38832].

Props justlevine, johnbillion.
See #64238.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php

    r61276 r61282  
    358358
    359359                $response = $is_head_request ? new WP_REST_Response( array() ) : rest_ensure_response( $comments );
    360                 $response->header( 'X-WP-Total', $total_comments );
    361                 $response->header( 'X-WP-TotalPages', $max_pages );
     360                $response->header( 'X-WP-Total', (string) $total_comments );
     361                $response->header( 'X-WP-TotalPages', (string) $max_pages );
    362362
    363363                $base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );
Note: See TracChangeset for help on using the changeset viewer.