Don't override a PHP memory_limit specified using G shorthand.

props peterjaap.
fixes #23251.

Built from https://develop.svn.wordpress.org/trunk@25684


git-svn-id: http://core.svn.wordpress.org/trunk@25600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-10-03 03:28:10 +00:00
parent 9e15ed5b28
commit f7f52354de
1 changed files with 5 additions and 1 deletions

View File

@ -41,7 +41,11 @@ function wp_initial_constants() {
// set memory limits.
if ( function_exists( 'memory_get_usage' ) ) {
$current_limit = @ini_get( 'memory_limit' );
if ( -1 != $current_limit && ( -1 == WP_MEMORY_LIMIT || ( intval( $current_limit ) < abs( intval( WP_MEMORY_LIMIT ) ) ) ) )
$current_limit_int = intval( $current_limit );
if ( false !== stripos( $current_limit, 'G' ) )
$current_limit_int *= 1024;
if ( -1 != $current_limit && ( -1 == WP_MEMORY_LIMIT || ( $current_limit_int < abs( intval( WP_MEMORY_LIMIT ) ) ) ) )
@ini_set( 'memory_limit', WP_MEMORY_LIMIT );
}