WordPress.org

Make WordPress Core

Changeset 23551


Ignore:
Timestamp:
03/01/2013 03:59:10 PM (9 years ago)
Author:
SergeyBiryukov
Message:

Make wp_convert_bytes_to_hr() return consistent results on 32-bit and 64-bit systems. fixes #23626.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/deprecated.php

    r23502 r23551  
    33793379    _deprecated_function( __FUNCTION__, '3.6', 'size_format()' );
    33803380
    3381     $units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' );
     3381    $units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB', 4 => 'TB' );
    33823382    $log   = log( $bytes, 1024 );
    33833383    $power = (int) $log;
    3384 
    3385     if ( array_key_exists( $power, $units ) ) {
    3386         $size  = pow( 1024, $log - $power );
     3384    $size  = pow( 1024, $log - $power );
     3385
     3386    if ( ! is_nan( $size ) && array_key_exists( $power, $units ) ) {
    33873387        $unit = $units[ $power ];
    33883388    } else {
Note: See TracChangeset for help on using the changeset viewer.