diff --git a/src/wp-includes/ms-functions.php b/src/wp-includes/ms-functions.php index 49f55cfa8d..dc92eb3cbd 100644 --- a/src/wp-includes/ms-functions.php +++ b/src/wp-includes/ms-functions.php @@ -2296,7 +2296,7 @@ function get_space_allowed() { if ( ! is_numeric( $space_allowed ) ) $space_allowed = get_site_option( 'blog_upload_space' ); - if ( empty( $space_allowed ) || ! is_numeric( $space_allowed ) ) + if ( ! is_numeric( $space_allowed ) ) $space_allowed = 100; /** diff --git a/tests/phpunit/tests/multisite/getSpaceAllowed.php b/tests/phpunit/tests/multisite/getSpaceAllowed.php index 069201ad85..6470f38592 100644 --- a/tests/phpunit/tests/multisite/getSpaceAllowed.php +++ b/tests/phpunit/tests/multisite/getSpaceAllowed.php @@ -94,10 +94,10 @@ class Tests_Multisite_Get_Space_Allowed extends WP_UnitTestCase { array( false, false, 100 ), array( 'NAN', 'NAN', 100 ), - // These are likely unexpected. - array( 0, 666, 100 ), - array( false, 0, 100 ), - array( 'NAN', 0, 100 ), + // These effectively disable uploads. + array( 0, 666, 0 ), + array( false, 0, 0 ), + array( 'NAN', 0, 0 ), ); } diff --git a/tests/phpunit/tests/multisite/isUploadSpaceAvailable.php b/tests/phpunit/tests/multisite/isUploadSpaceAvailable.php index 36be275944..d2abfd2337 100644 --- a/tests/phpunit/tests/multisite/isUploadSpaceAvailable.php +++ b/tests/phpunit/tests/multisite/isUploadSpaceAvailable.php @@ -102,7 +102,7 @@ class Tests_Multisite_Is_Upload_Space_Available extends WP_UnitTestCase { $available = is_upload_space_available(); remove_filter( 'pre_get_space_used', array( $this, '_filter_space_used_small' ) ); - $this->assertTrue( $available ); + $this->assertFalse( $available ); } function test_is_upload_space_available_upload_space_negative() {