From dd954607e02330f80317885e410a5b949e1ca34d Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 3 Oct 2013 03:46:09 +0000 Subject: [PATCH] Support G shorthand for WP_MEMORY_LIMIT. see #23251. Built from https://develop.svn.wordpress.org/trunk@25685 git-svn-id: http://core.svn.wordpress.org/trunk@25601 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/default-constants.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/default-constants.php b/wp-includes/default-constants.php index 34750057be..bc6c79a80b 100644 --- a/wp-includes/default-constants.php +++ b/wp-includes/default-constants.php @@ -44,8 +44,11 @@ function wp_initial_constants() { $current_limit_int = intval( $current_limit ); if ( false !== stripos( $current_limit, 'G' ) ) $current_limit_int *= 1024; + $wp_limit_int = intval( WP_MEMORY_LIMIT ); + if ( false !== stripos( WP_MEMORY_LIMIT, 'G' ) ) + $wp_limit_int *= 1024; - if ( -1 != $current_limit && ( -1 == WP_MEMORY_LIMIT || ( $current_limit_int < abs( intval( WP_MEMORY_LIMIT ) ) ) ) ) + if ( -1 != $current_limit && ( -1 == WP_MEMORY_LIMIT || $current_limit_int < $wp_limit_int ) ) @ini_set( 'memory_limit', WP_MEMORY_LIMIT ); }