Make WordPress Core

Ticket #56041: 56041.diff

File 56041.diff, 883 bytes (added by costdev, 2 years ago)

Fixes the @return type for the 'site_status_page_cache_supported_cache_headers' filter and uses str_contains() (polyfilled in WP 5.9)

  • src/wp-admin/includes/class-wp-site-health.php

    diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php
    index 70f5b7c6ad..4c6b91f904 100644
    a b class WP_Site_Health { 
    30993099        public function get_page_cache_headers() {
    31003100
    31013101                $cache_hit_callback = static function ( $header_value ) {
    3102                         return false !== strpos( strtolower( $header_value ), 'hit' );
     3102                        return str_contains( strtolower( $header_value ), 'hit' );
    31033103                };
    31043104
    31053105                $cache_headers = array(
    class WP_Site_Health { 
    31293129                 *
    31303130                 * @since 6.1.0
    31313131                 *
    3132                  * @param int $cache_headers Array of supported cache headers.
     3132                 * @param array $cache_headers Array of supported cache headers.
    31333133                 */
    31343134                return apply_filters( 'site_status_page_cache_supported_cache_headers', $cache_headers );
    31353135        }