Filesystem: Following the introduction of the KB|MB|GB|TB_IN_BYTES constants in [35286], use them in various places in core.

Props sudar.
Fixes #22405.

Built from https://develop.svn.wordpress.org/trunk@35325


git-svn-id: http://core.svn.wordpress.org/trunk@35291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes
2015-10-21 14:03:25 +00:00
parent 6a51505a23
commit 81524f3bfc
7 changed files with 30 additions and 25 deletions

View File

@@ -3284,9 +3284,9 @@ function wp_convert_bytes_to_hr( $bytes ) {
_deprecated_function( __FUNCTION__, '3.6', 'size_format()' );
$units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB', 4 => 'TB' );
$log = log( $bytes, 1024 );
$log = log( $bytes, KB_IN_BYTES );
$power = (int) $log;
$size = pow( 1024, $log - $power );
$size = pow( KB_IN_BYTES, $log - $power );
if ( ! is_nan( $size ) && array_key_exists( $power, $units ) ) {
$unit = $units[ $power ];