From 4b60c38a3694a6f28f8f6e51334afa13a4415632 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 9 Oct 2021 02:49:02 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@51898 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-site-health.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php index 8a6fa79827..6b0a254476 100644 --- a/src/wp-admin/includes/class-wp-site-health.php +++ b/src/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(