From 88e668d8e6e445488feca43c0fd2467b01ad5db2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 16 Aug 2020 17:48:08 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@48800 git-svn-id: http://core.svn.wordpress.org/trunk@48562 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-site-health.php | 6 +++--- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/class-wp-site-health.php b/wp-admin/includes/class-wp-site-health.php index 2fd570318d..94bc35b834 100644 --- a/wp-admin/includes/class-wp-site-health.php +++ b/wp-admin/includes/class-wp-site-health.php @@ -2049,10 +2049,10 @@ class WP_Site_Health { $post_max_size = ini_get( 'post_max_size' ); $upload_max_size = ini_get( 'upload_max_filesize' ); - if ( wp_convert_hr_to_bytes( $post_max_size ) !== wp_convert_hr_to_bytes( $upload_max_size ) ) { + if ( wp_convert_hr_to_bytes( $post_max_size ) < wp_convert_hr_to_bytes( $upload_max_size ) ) { $result['label'] = sprintf( /* translators: 1: post_max_size, 2: upload_max_filesize */ - __( 'Mismatched "%1$s" and "%2$s" values.' ), + __( 'The "%1$s" value is smaller than "%2$s".' ), 'post_max_size', 'upload_max_filesize' ); @@ -2061,7 +2061,7 @@ class WP_Site_Health { '

%s

', sprintf( /* translators: 1: post_max_size, 2: upload_max_filesize */ - __( 'The settings for %1$s and %2$s are not the same, this could cause some problems when trying to upload files.' ), + __( 'The setting for %1$s is smaller than %2$s, this could cause some problems when trying to upload files.' ), 'post_max_size', 'upload_max_filesize' ) diff --git a/wp-includes/version.php b/wp-includes/version.php index 74153d3412..7bf4916ebd 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-alpha-48799'; +$wp_version = '5.6-alpha-48800'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.