From 0f2d2264b587c2d3c986c61495311e263286faac Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 9 Oct 2021 02:50:56 +0000 Subject: [PATCH] Site Health: Use an integer value as a fallback in the available disk space check. This avoids a few type problems further in the code: boolean divided by a number, or passing `false` to `size_format()` which is documented to accept integers or strings only. Follow-up to [51815]. Props TobiasBg. See #51857. Built from https://develop.svn.wordpress.org/trunk@51898 git-svn-id: http://core.svn.wordpress.org/trunk@51491 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-site-health.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/class-wp-site-health.php b/wp-admin/includes/class-wp-site-health.php index 8a6fa79827..6b0a254476 100644 --- a/wp-admin/includes/class-wp-site-health.php +++ b/wp-admin/includes/class-wp-site-health.php @@ -1890,7 +1890,7 @@ class WP_Site_Health { * @return array The test results. */ public function get_test_available_updates_disk_space() { - $available_space = function_exists( 'disk_free_space' ) ? (int) @disk_free_space( WP_CONTENT_DIR . '/upgrade/' ) : false; + $available_space = function_exists( 'disk_free_space' ) ? (int) @disk_free_space( WP_CONTENT_DIR . '/upgrade/' ) : 0; $available_space_in_mb = $available_space / MB_IN_BYTES; $result = array( diff --git a/wp-includes/version.php b/wp-includes/version.php index 42aa9eefe8..5d1051425c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-51897'; +$wp_version = '5.9-alpha-51898'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.