Make WordPress Core


Ignore:
Timestamp:
08/17/2020 01:27:29 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Site Health: Only display the warning about the post_max_size PHP value when it's lower than upload_max_filesize.

Previously, the warning was displayed even if the value was higher than upload_max_filesize, which made the report inaccurate, as these values don't necessarily have to match.

Props oakesjosh, jeroenrotty, desrosj, Clorith.
Merges [48800] and [48801] to the 5.5 branch.
Fixes #50945.

Location:
branches/5.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.5

  • branches/5.5/src/wp-admin/includes/class-wp-debug-data.php

    r48805 r48806  
    538538        } else {
    539539            // Get the PHP ini directive values.
    540             $post_max_size    = ini_get( 'post_max_size' );
    541             $upload_max_size = ini_get( 'upload_max_filesize' );
    542             $max_file_uploads = ini_get( 'max_file_uploads' );
    543             $effective        = min( wp_convert_hr_to_bytes( $post_max_size ), wp_convert_hr_to_bytes( $upload_max_size ) );
     540            $post_max_size       = ini_get( 'post_max_size' );
     541            $upload_max_filesize = ini_get( 'upload_max_filesize' );
     542            $max_file_uploads    = ini_get( 'max_file_uploads' );
     543            $effective           = min( wp_convert_hr_to_bytes( $post_max_size ), wp_convert_hr_to_bytes( $upload_max_filesize ) );
    544544
    545545            // Add info in Media section.
     
    555555            $info['wp-media']['fields']['upload_max_filesize'] = array(
    556556                'label' => __( 'Max size of an uploaded file' ),
    557                 'value' => $upload_max_size,
     557                'value' => $upload_max_filesize,
    558558            );
    559559            $info['wp-media']['fields']['max_effective_size']  = array(
     
    718718            }
    719719
    720             $info['wp-server']['fields']['max_input_time']    = array(
     720            $info['wp-server']['fields']['max_input_time']      = array(
    721721                'label' => __( 'Max input time' ),
    722722                'value' => ini_get( 'max_input_time' ),
    723723            );
    724             $info['wp-server']['fields']['upload_max_size']  = array(
     724            $info['wp-server']['fields']['upload_max_filesize'] = array(
    725725                'label' => __( 'Upload max filesize' ),
    726726                'value' => ini_get( 'upload_max_filesize' ),
    727727            );
    728             $info['wp-server']['fields']['php_post_max_size'] = array(
     728            $info['wp-server']['fields']['php_post_max_size']   = array(
    729729                'label' => __( 'PHP post max size' ),
    730730                'value' => ini_get( 'post_max_size' ),
Note: See TracChangeset for help on using the changeset viewer.