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.


git-svn-id: https://develop.svn.wordpress.org/trunk@35325 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Drew Jaynes
2015-10-21 14:02:59 +00:00
parent 86794324c7
commit a28e35e462
6 changed files with 29 additions and 24 deletions
+2 -2
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 ];