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

View File

@@ -210,12 +210,11 @@ function number_format_i18n( $number, $decimals = 0 ) {
*/
function size_format( $bytes, $decimals = 0 ) {
$quant = array(
// ========================= Origin ====
'TB' => 1099511627776, // pow( 1024, 4)
'GB' => 1073741824, // pow( 1024, 3)
'MB' => 1048576, // pow( 1024, 2)
'kB' => 1024, // pow( 1024, 1)
'B' => 1, // pow( 1024, 0)
'TB' => TB_IN_BYTES,
'GB' => GB_IN_BYTES,
'MB' => MB_IN_BYTES,
'kB' => KB_IN_BYTES,
'B' => 1,
);
foreach ( $quant as $unit => $mag ) {