| 620 | | /* |
| 621 | | * disk_free_space() could return false. Assume that any falsey value is an error. |
| 622 | | * A disk that has zero free bytes has bigger problems. |
| 623 | | * Require we have enough space to unzip the file and copy its contents, with a 10% buffer. |
| 624 | | */ |
| 625 | | $available_space = @disk_free_space( WP_CONTENT_DIR ); |
| 626 | | if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space ) |
| 627 | | 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' ) ); |
| | 620 | if ( defined( 'DOING_CRON' ) && DOING_CRON ) { |
| | 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 | */ |
| | 626 | $available_space = @disk_free_space( WP_CONTENT_DIR ); |
| | 627 | if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space ) |
| | 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' ) ); |
| | 629 | } |
| 720 | | /* |
| 721 | | * disk_free_space() could return false. Assume that any falsey value is an error. |
| 722 | | * A disk that has zero free bytes has bigger problems. |
| 723 | | * Require we have enough space to unzip the file and copy its contents, with a 10% buffer. |
| 724 | | */ |
| 725 | | $available_space = @disk_free_space( WP_CONTENT_DIR ); |
| 726 | | if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space ) |
| 727 | | 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' ) ); |
| | 722 | if ( defined( 'DOING_CRON' ) && DOING_CRON ) { |
| | 723 | /* |
| | 724 | * disk_free_space() could return false. Assume that any falsey value is an error. |
| | 725 | * A disk that has zero free bytes has bigger problems. |
| | 726 | * Require we have enough space to unzip the file and copy its contents, with a 10% buffer. |
| | 727 | */ |
| | 728 | $available_space = @disk_free_space( WP_CONTENT_DIR ); |
| | 729 | if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space ) |
| | 730 | 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' ) ); |
| | 731 | } |