From 78630626787e17d25085d1a2e8dc6a1590c2fcf9 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 16 Feb 2013 03:59:37 +0000 Subject: [PATCH] Restore the original wp_convert_bytes_to_hr() code. fixes #19067. git-svn-id: http://core.svn.wordpress.org/trunk@23440 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/deprecated.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index e89332f53a..bde4ea8c7b 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -3377,5 +3377,9 @@ function gd_edit_image_support($mime_type) { */ function wp_convert_bytes_to_hr( $bytes ) { _deprecated_function( __FUNCTION__, '3.6', 'size_format()' ); - return size_format( $bytes ); + $units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' ); + $log = log( $bytes, 1024 ); + $power = (int) $log; + $size = pow( 1024, $log - $power ); + return $size . $units[$power]; }