Skip to content

Commit

Permalink
Coding Standards: Use a human-readable constant in the check for max …
Browse files Browse the repository at this point in the history
…memory limit.

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

See #61607.

git-svn-id: https://develop.svn.wordpress.org/trunk@58938 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Aug 26, 2024
1 parent a88dab1 commit f2e5e93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wp-includes/default-constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ function wp_initial_constants() {
if ( ! defined( 'WP_MAX_MEMORY_LIMIT' ) ) {
if ( false === wp_is_ini_value_changeable( 'memory_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 );
} 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 );
} else {
define( 'WP_MAX_MEMORY_LIMIT', '256M' );
Expand Down

0 comments on commit f2e5e93

Please sign in to comment.