WordPress.org

Make WordPress Core

Changeset 51898


Ignore:
Timestamp:
10/09/2021 02:49:02 AM (2 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-site-health.php

    r51815 r51898  
    18911891     */
    18921892    public function get_test_available_updates_disk_space() {
    1893         $available_space       = function_exists( 'disk_free_space' ) ? (int) @disk_free_space( WP_CONTENT_DIR . '/upgrade/' ) : false;
     1893        $available_space       = function_exists( 'disk_free_space' ) ? (int) @disk_free_space( WP_CONTENT_DIR . '/upgrade/' ) : 0;
    18941894        $available_space_in_mb = $available_space / MB_IN_BYTES;
    18951895
Note: See TracChangeset for help on using the changeset viewer.