Make WordPress Core

Changeset 48800


Ignore:
Timestamp:
08/16/2020 05:46:51 PM (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.
Fixes #50945.

File:
1 edited

Legend:

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

    r48782 r48800  
    20502050        $upload_max_size = ini_get( 'upload_max_filesize' );
    20512051
    2052         if ( wp_convert_hr_to_bytes( $post_max_size ) !== wp_convert_hr_to_bytes( $upload_max_size ) ) {
     2052        if ( wp_convert_hr_to_bytes( $post_max_size ) < wp_convert_hr_to_bytes( $upload_max_size ) ) {
    20532053            $result['label'] = sprintf(
    20542054                /* translators: 1: post_max_size, 2: upload_max_filesize */
    2055                 __( 'Mismatched "%1$s" and "%2$s" values.' ),
     2055                __( 'The "%1$s" value is smaller than "%2$s".' ),
    20562056                'post_max_size',
    20572057                'upload_max_filesize'
     
    20622062                sprintf(
    20632063                    /* translators: 1: post_max_size, 2: upload_max_filesize */
    2064                     __( 'The settings for %1$s and %2$s are not the same, this could cause some problems when trying to upload files.' ),
     2064                    __( 'The setting for %1$s is smaller than %2$s, this could cause some problems when trying to upload files.' ),
    20652065                    '<code>post_max_size</code>',
    20662066                    '<code>upload_max_filesize</code>'
Note: See TracChangeset for help on using the changeset viewer.