Make WordPress Core


Ignore:
Timestamp:
08/19/2024 03:19:27 PM (7 weeks ago)
Author:
SergeyBiryukov
Message:

Site Health: Correct the check for disk space available to safely perform updates.

The wp-content/upgrade directory does not exist initially after installation, so the Site Health check could not determine the available disk space until the directory was subsequently created during an update.

By testing WP_CONTENT_DIR instead, the check can complete successfully.

This also brings consistency with similar checks in _unzip_file_ziparchive() and _unzip_file_pclzip().

Follow-up to [55720], [56401].

Props wbdv, khokansardar, mi5t4n, SergeyBiryukov.
Fixes #61602.

File:
1 edited

Legend:

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

    r58832 r58913  
    18181818     */
    18191819    public function get_test_available_updates_disk_space() {
    1820         $available_space = function_exists( 'disk_free_space' ) ? @disk_free_space( WP_CONTENT_DIR . '/upgrade/' ) : false;
     1820        $available_space = function_exists( 'disk_free_space' ) ? @disk_free_space( WP_CONTENT_DIR ) : false;
    18211821
    18221822        $result = array(
Note: See TracChangeset for help on using the changeset viewer.