Make WordPress Core

Changeset 37702


Ignore:
Timestamp:
06/14/2016 09:40:02 PM (8 years ago)
Author:
SergeyBiryukov
Message:

In size_format() and wp_convert_bytes_to_hr(), replace kB with KB for consistency with other units.

Props Presskopp, dashaluna.
Fixes #37037.

Location:
trunk
Files:
3 edited

Legend:

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

    r37676 r37702  
    33303330    _deprecated_function( __FUNCTION__, '3.6', 'size_format()' );
    33313331
    3332     $units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB', 4 => 'TB' );
     3332    $units = array( 0 => 'B', 1 => 'KB', 2 => 'MB', 3 => 'GB', 4 => 'TB' );
    33333333    $log   = log( $bytes, KB_IN_BYTES );
    33343334    $power = (int) $log;
  • trunk/src/wp-includes/functions.php

    r37689 r37702  
    238238 * Convert number of bytes largest unit bytes will fit into.
    239239 *
    240  * It is easier to read 1 kB than 1024 bytes and 1 MB than 1048576 bytes. Converts
     240 * It is easier to read 1 KB than 1024 bytes and 1 MB than 1048576 bytes. Converts
    241241 * number of bytes to human readable number by taking the number of that unit
    242242 * that the bytes will go into it. Supports TB value.
     
    260260        'GB' => GB_IN_BYTES,
    261261        'MB' => MB_IN_BYTES,
    262         'kB' => KB_IN_BYTES,
     262        'KB' => KB_IN_BYTES,
    263263        'B'  => 1,
    264264    );
  • trunk/tests/phpunit/tests/media.php

    r37627 r37702  
    274274        $this->assertEquals( '1GB', wp_convert_bytes_to_hr( $gb ) );
    275275        $this->assertEquals( '1MB', wp_convert_bytes_to_hr( $mb ) );
    276         $this->assertEquals( '1kB', wp_convert_bytes_to_hr( $kb ) );
     276        $this->assertEquals( '1KB', wp_convert_bytes_to_hr( $kb ) );
    277277
    278278        $this->assertEquals( '1 TB', size_format( $tb ) );
    279279        $this->assertEquals( '1 GB', size_format( $gb ) );
    280280        $this->assertEquals( '1 MB', size_format( $mb ) );
    281         $this->assertEquals( '1 kB', size_format( $kb ) );
     281        $this->assertEquals( '1 KB', size_format( $kb ) );
    282282
    283283        // now some values around
Note: See TracChangeset for help on using the changeset viewer.