Make WordPress Core


Ignore:
Timestamp:
08/26/2024 08:55:29 PM (6 weeks ago)
Author:
SergeyBiryukov
Message:

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

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

See #61607.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-constants.php

    r58937 r58938  
    5757        if ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) {
    5858            define( 'WP_MAX_MEMORY_LIMIT', $current_limit );
    59         } elseif ( -1 === $current_limit_int || $current_limit_int > 268435456 /* = 256M */ ) {
     59        } elseif ( -1 === $current_limit_int || $current_limit_int > 256 * MB_IN_BYTES ) {
    6060            define( 'WP_MAX_MEMORY_LIMIT', $current_limit );
    61         } elseif ( wp_convert_hr_to_bytes( WP_MEMORY_LIMIT ) > 268435456 /* = 256M */ ) {
     61        } elseif ( wp_convert_hr_to_bytes( WP_MEMORY_LIMIT ) > 256 * MB_IN_BYTES ) {
    6262            define( 'WP_MAX_MEMORY_LIMIT', WP_MEMORY_LIMIT );
    6363        } else {
Note: See TracChangeset for help on using the changeset viewer.