Coding Standards: Use a human-readable constant in the check for max memory limit.

Follow-up to [35286], [38011], [38015], [58937].

See #61607.
Built from https://develop.svn.wordpress.org/trunk@58938


git-svn-id: http://core.svn.wordpress.org/trunk@58334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2024-08-26 20:57:13 +00:00
parent ddd7f2142e
commit 3014749ed9
2 changed files with 3 additions and 3 deletions

View File

@ -56,9 +56,9 @@ function wp_initial_constants() {
if ( ! defined( 'WP_MAX_MEMORY_LIMIT' ) ) { if ( ! defined( 'WP_MAX_MEMORY_LIMIT' ) ) {
if ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) { if ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) {
define( 'WP_MAX_MEMORY_LIMIT', $current_limit ); define( 'WP_MAX_MEMORY_LIMIT', $current_limit );
} elseif ( -1 === $current_limit_int || $current_limit_int > 268435456 /* = 256M */ ) { } elseif ( -1 === $current_limit_int || $current_limit_int > 256 * MB_IN_BYTES ) {
define( 'WP_MAX_MEMORY_LIMIT', $current_limit ); define( 'WP_MAX_MEMORY_LIMIT', $current_limit );
} elseif ( wp_convert_hr_to_bytes( WP_MEMORY_LIMIT ) > 268435456 /* = 256M */ ) { } elseif ( wp_convert_hr_to_bytes( WP_MEMORY_LIMIT ) > 256 * MB_IN_BYTES ) {
define( 'WP_MAX_MEMORY_LIMIT', WP_MEMORY_LIMIT ); define( 'WP_MAX_MEMORY_LIMIT', WP_MEMORY_LIMIT );
} else { } else {
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); define( 'WP_MAX_MEMORY_LIMIT', '256M' );

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.7-alpha-58937'; $wp_version = '6.7-alpha-58938';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.