WordPress.org

Make WordPress Core

Ticket #14772: fatal.patch

File fatal.patch, 856 bytes (added by dd32, 3 years ago)
  • wp-includes/admin-bar/admin-bar-debug.php

     
    139139 
    140140        $query_count = '<h2><span>Total Queries:</span>' . number_format( $wpdb->num_queries ) . "</h2>\n"; 
    141141        $query_time = '<h2><span>Total query time:</span>' . number_format(sprintf('%0.1f', $total_time * 1000), 1) . "ms</h2>\n"; 
    142         $memory_usage = '<h2><span>Peak Memory Used:</span>' . number_format( memory_get_peak_usage( ) ) . " bytes</h2>\n"; 
     142        $memory_usage = '<h2><span>Peak Memory Used:</span>' . (function_exists('memory_get_peak_usage') ? number_format( memory_get_peak_usage( ) ) : 'Unavailable') . " bytes</h2>\n"; 
    143143 
    144144        $out = $query_count . $query_time . $memory_usage . $out; 
    145145