Site Health: Remove parse_ini_size(), use the existing wp_convert_hr_to_bytes() function instead.

Follow-up to [48535].

See #50038.

git-svn-id: https://develop.svn.wordpress.org/trunk@48538 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-07-21 15:38:40 +00:00
parent 09754a7cdd
commit 0d956d4013
3 changed files with 6 additions and 35 deletions
@@ -534,7 +534,7 @@ class WP_Debug_Data {
$post_max_size = ini_get( 'post_max_size' );
$upload_max_size = ini_get( 'upload_max_filesize' );
$max_file_uploads = ini_get( 'max_file_uploads' );
$effective = min( parse_ini_size( $post_max_size ), parse_ini_size( $upload_max_size ) );
$effective = min( wp_convert_hr_to_bytes( $post_max_size ), wp_convert_hr_to_bytes( $upload_max_size ) );
// Add info in Media section.
$info['wp-media']['fields']['file_uploads'] = array(
@@ -1956,7 +1956,7 @@ class WP_Site_Health {
}
/**
* Test if 'file_uploads' directive in PHP.ini is turned off
* Test if 'file_uploads' directive in PHP.ini is turned off.
*
* @since 5.5.0
*
@@ -2007,7 +2007,10 @@ class WP_Site_Health {
return $result;
}
if ( parse_ini_size( ini_get( 'post_max_size' ) ) !== parse_ini_size( ini_get( 'upload_max_filesize' ) ) ) {
$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 ) ) {
$result['label'] = __( 'Mismatched "post_max_size" and "upload_max_filesize" values.' );
$result['status'] = 'recommended';
$result['description'] = sprintf(