From ddd7f2142e08aadc52b39ae984575739596e0bd0 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Mon, 26 Aug 2024 20:14:14 +0000 Subject: [PATCH] Administration: Avoid using `WP_MAX_MEMORY_LIMIT` default that is smaller than `WP_MEMORY_LIMIT`. Props eclare, dd32, pbearne. Fixes #36426. Built from https://develop.svn.wordpress.org/trunk@58937 git-svn-id: http://core.svn.wordpress.org/trunk@58333 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/default-constants.php | 2 ++ wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/default-constants.php b/wp-includes/default-constants.php index 79e16428ed..f1c0320a6f 100644 --- a/wp-includes/default-constants.php +++ b/wp-includes/default-constants.php @@ -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' ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 38331689fd..929903c120 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-58936'; +$wp_version = '6.7-alpha-58937'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.