Ticket #36426: 36426.diff
File 36426.diff, 1.4 KB (added by , 9 years ago) |
---|
-
src/wp-includes/default-constants.php
function wp_initial_constants() { 35 35 if ( ! defined( 'WP_MEMORY_LIMIT' ) ) { 36 36 if ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) { 37 37 define( 'WP_MEMORY_LIMIT', $current_limit ); 38 38 } elseif ( is_multisite() ) { 39 39 define( 'WP_MEMORY_LIMIT', '64M' ); 40 40 } else { 41 41 define( 'WP_MEMORY_LIMIT', '40M' ); 42 42 } 43 43 } 44 44 45 45 if ( ! defined( 'WP_MAX_MEMORY_LIMIT' ) ) { 46 46 if ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) { 47 47 define( 'WP_MAX_MEMORY_LIMIT', $current_limit ); 48 48 } elseif ( -1 === $current_limit_int || $current_limit_int > 268435456 /* = 256M */ ) { 49 49 define( 'WP_MAX_MEMORY_LIMIT', $current_limit ); 50 } elseif ( wp_convert_hr_to_bytes( WP_MEMORY_LIMIT ) > 268435456 /* = 256M */ ) { 51 define( 'WP_MAX_MEMORY_LIMIT', WP_MEMORY_LIMIT ); 50 52 } else { 51 53 define( 'WP_MAX_MEMORY_LIMIT', '256M' ); 52 54 } 53 55 } 54 56 55 57 // Set memory limits. 56 58 $wp_limit_int = wp_convert_hr_to_bytes( WP_MEMORY_LIMIT ); 57 59 if ( -1 !== $current_limit_int && ( -1 === $wp_limit_int || $wp_limit_int > $current_limit_int ) ) { 58 60 @ini_set( 'memory_limit', WP_MEMORY_LIMIT ); 59 61 } 60 62 61 63 if ( ! isset($blog_id) ) 62 64 $blog_id = 1; 63 65 64 66 if ( !defined('WP_CONTENT_DIR') )