Skip to content

Commit

Permalink
Administration: Avoid using WP_MAX_MEMORY_LIMIT default that is sma…
Browse files Browse the repository at this point in the history
…ller than `WP_MEMORY_LIMIT`.

Props eclare, dd32, pbearne.
Fixes #36426.


git-svn-id: https://develop.svn.wordpress.org/trunk@58937 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
felixarntz committed Aug 26, 2024
1 parent 830d66c commit a88dab1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/wp-includes/default-constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ function wp_initial_constants() {
define( 'WP_MAX_MEMORY_LIMIT', $current_limit );
} elseif ( -1 === $current_limit_int || $current_limit_int > 268435456 /* = 256M */ ) {
define( 'WP_MAX_MEMORY_LIMIT', $current_limit );
} elseif ( wp_convert_hr_to_bytes( WP_MEMORY_LIMIT ) > 268435456 /* = 256M */ ) {
define( 'WP_MAX_MEMORY_LIMIT', WP_MEMORY_LIMIT );
} else {
define( 'WP_MAX_MEMORY_LIMIT', '256M' );
}
Expand Down

0 comments on commit a88dab1

Please sign in to comment.