Account for the possible failure of disk_free_space() in update_core().
see #22704, #25576. Built from https://develop.svn.wordpress.org/trunk@25778 git-svn-id: http://core.svn.wordpress.org/trunk@25691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3e3c085db3
commit
4fa3687e6a
|
@ -740,8 +740,10 @@ function update_core($from, $to) {
|
||||||
foreach ( $failed as $file )
|
foreach ( $failed as $file )
|
||||||
$total_size += filesize( $working_dir_local . '/' . $file );
|
$total_size += filesize( $working_dir_local . '/' . $file );
|
||||||
|
|
||||||
// If we don't have enough free space, it isn't worth trying again
|
// If we don't have enough free space, it isn't worth trying again.
|
||||||
if ( $total_size >= disk_free_space( ABSPATH ) ) {
|
// Unlikely to be hit due to the check in unzip_file().
|
||||||
|
$available_space = disk_free_space( ABSPATH );
|
||||||
|
if ( $available_space && $total_size >= $available_space ) {
|
||||||
$result = new WP_Error( 'disk_full', __( 'There is not enough free disk space to complete the update.' ), $to );
|
$result = new WP_Error( 'disk_full', __( 'There is not enough free disk space to complete the update.' ), $to );
|
||||||
} else {
|
} else {
|
||||||
$result = _copy_dir( $from . $distro, $to, $skip );
|
$result = _copy_dir( $from . $distro, $to, $skip );
|
||||||
|
|
Loading…
Reference in New Issue