Changeset 25776
- Timestamp:
- 10/14/2013 08:57:28 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r25774 r25776 619 619 } 620 620 621 /* 622 * disk_free_space() could return false. Assume that any falsey value is an error. 623 * A disk that has zero free bytes has bigger problems. 624 * Require we have enough space to unzip the file and copy its contents, with a 10% buffer. 625 */ 621 626 $available_space = disk_free_space( WP_CONTENT_DIR ); 622 if ( ( $uncompressed_size * 1.2) > $available_space )627 if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space ) 623 628 return new WP_Error( 'disk_full_unzip_file', __( 'Could not copy files. You may have run out of disk space.' ), compact( 'uncompressed_size', 'available_space' ) ); 624 629 … … 714 719 } 715 720 721 /* 722 * disk_free_space() could return false. Assume that any falsey value is an error. 723 * A disk that has zero free bytes has bigger problems. 724 * Require we have enough space to unzip the file and copy its contents, with a 10% buffer. 725 */ 716 726 $available_space = disk_free_space( WP_CONTENT_DIR ); 717 if ( ( $uncompressed_size * 1.2) > $available_space )727 if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space ) 718 728 return new WP_Error( 'disk_full_unzip_file', __( 'Could not copy files. You may have run out of disk space.' ), compact( 'uncompressed_size', 'available_space' ) ); 719 729
Note: See TracChangeset
for help on using the changeset viewer.