diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 96cabb329b..9571fb5b04 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -1400,6 +1400,16 @@ function media_upload_form( $errors = null ) { $flash = apply_filters('flash_uploader', $flash); $post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0; + $upload_size_unit = $max_upload_size = wp_max_upload_size(); + $sizes = array( 'KB', 'MB', 'GB' ); + for ( $u = -1; $upload_size_unit > 1024 && $u < count( $sizes ) - 1; $u++ ) + $upload_size_unit /= 1024; + if ( $u < 0 ) { + $upload_size_unit = 0; + $u = 0; + } else { + $upload_size_unit = (int) $upload_size_unit; + } ?>