Changeset 35325 for trunk/src/wp-admin/includes/ms.php
- Timestamp:
- 10/21/2015 02:02:59 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ms.php
r35182 r35325 29 29 30 30 $file_size = filesize( $file['tmp_name'] ); 31 if ( $space_left < $file_size ) 32 $file['error'] = sprintf( __( 'Not enough space to upload. %1$s KB needed.' ), number_format( ($file_size - $space_left) /1024 ) ); 33 if ( $file_size > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) ) 34 $file['error'] = sprintf(__('This file is too big. Files must be less than %1$s KB in size.'), get_site_option( 'fileupload_maxk', 1500 ) ); 31 if ( $space_left < $file_size ) { 32 $file['error'] = sprintf( __( 'Not enough space to upload. %1$s KB needed.' ), number_format( ( $file_size - $space_left ) / KB_IN_BYTES ) ); 33 } 34 35 if ( $file_size > ( KB_IN_BYTES * get_site_option( 'fileupload_maxk', 1500 ) ) ) { 36 $file['error'] = sprintf( __( 'This file is too big. Files must be less than %1$s KB in size.' ), get_site_option( 'fileupload_maxk', 1500 ) ); 37 } 38 35 39 if ( upload_is_user_over_quota( false ) ) { 36 40 $file['error'] = __( 'You have used your space quota. Please delete files before uploading.' ); 37 41 } 42 38 43 if ( $file['error'] != '0' && ! isset( $_POST['html-upload'] ) && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) { 39 44 wp_die( $file['error'] . ' <a href="javascript:history.go(-1)">' . __( 'Back' ) . '</a>' ); … … 444 449 445 450 if ( $space_allowed > 1000 ) { 446 $space = number_format( $space_allowed / 1024);451 $space = number_format( $space_allowed / KB_IN_BYTES ); 447 452 /* translators: Gigabytes */ 448 453 $space .= __( 'GB' );
Note: See TracChangeset
for help on using the changeset viewer.