Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 6282)
+++ wp-includes/functions.php	(working copy)
@@ -89,8 +89,17 @@
 	return number_format( $number, $decimals, $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] );
 }
 
-
+/**
+ * Formats a size with the correct byte suffix.
+ *
+ * @param number $bytes number of bytes to format
+ * @param int $decimals number of digits after the decimal point to be used, optional
+ * @return string|bool formatted number (according to current locale) with the correct suffix (KB, MB, etc.) in the end or false on error
+ */
 function size_format( $bytes, $decimals = null ) {
+	if (!is_numeric($bytes)) {
+		return false;
+	}
 	// technically the correct unit names for powers of 1024 are KiB, MiB etc
 	// see http://en.wikipedia.org/wiki/Byte
 	$quant = array(
@@ -98,13 +107,14 @@
 		'TB' => 1099511627776,  // pow( 1024, 4)
 		'GB' => 1073741824,     // pow( 1024, 3)
 		'MB' => 1048576,        // pow( 1024, 2)
-		'kB' => 1024,           // pow( 1024, 1)
+		'KB' => 1024,           // pow( 1024, 1)
 		'B ' => 1,              // pow( 1024, 0)
 	);
 
 	foreach ( $quant as $unit => $mag )
-		if ( intval( $bytes ) >= $mag )
+		if ( $bytes >= $mag )
 			return number_format_i18n( $bytes / $mag, $decimals ) . ' ' . $unit;
+	return false;
 }
 
 
@@ -1484,4 +1494,4 @@
 	return abs( intval( $maybeint ) );
 }
 
-?>
\ No newline at end of file
+?>
