General: Return "O B" when passing 0 to `size_format()`.
Props swissspidy. Fixes #36635. Built from https://develop.svn.wordpress.org/trunk@37962 git-svn-id: http://core.svn.wordpress.org/trunk@37903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a5580012a3
commit
9b893cd558
|
@ -263,6 +263,10 @@ function size_format( $bytes, $decimals = 0 ) {
|
||||||
'B' => 1,
|
'B' => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ( 0 === $bytes ) {
|
||||||
|
return number_format_i18n( 0, $decimals ) . ' B';
|
||||||
|
}
|
||||||
|
|
||||||
foreach ( $quant as $unit => $mag ) {
|
foreach ( $quant as $unit => $mag ) {
|
||||||
if ( doubleval( $bytes ) >= $mag ) {
|
if ( doubleval( $bytes ) >= $mag ) {
|
||||||
return number_format_i18n( $bytes / $mag, $decimals ) . ' ' . $unit;
|
return number_format_i18n( $bytes / $mag, $decimals ) . ' ' . $unit;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.6-beta1-37961';
|
$wp_version = '4.6-beta1-37962';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue