Make WordPress Core

Ticket #21650: 21650.diff

File 21650.diff, 889 bytes (added by desrosj, 2 years ago)
  • src/wp-includes/class-wp-object-cache.php

    diff --git a/src/wp-includes/class-wp-object-cache.php b/src/wp-includes/class-wp-object-cache.php
    index 89fd6ff011..e1a1b233a6 100644
    a b class WP_Object_Cache { 
    557557                echo '</p>';
    558558                echo '<ul>';
    559559                foreach ( $this->cache as $group => $cache ) {
    560                         echo '<li><strong>Group:</strong> ' . esc_html( $group ) . ' - ( ' . number_format( strlen( serialize( $cache ) ) / KB_IN_BYTES, 2 ) . 'k )</li>';
     560                        try {
     561                                echo '<li><strong>Group:</strong> ' . esc_html( $group ) . ' - ( ' . number_format( strlen( serialize( $cache ) ) / KB_IN_BYTES, 2 ) . 'k )</li>';
     562                        } catch( Exception $e ) {
     563                                echo '<li><strong>Group:</strong> ' . esc_html( $group ) . ' - ( ' . number_format( strlen( print_r( $cache, true ) ) / KB_IN_BYTES, 2 ) . 'k )</li>';
     564                        }
    561565                }
    562566                echo '</ul>';
    563567        }