WordPress.org

Make WordPress Core

Ticket #14889: 14889.4.diff

File 14889.4.diff, 904 bytes (added by hakre, 4 years ago)

minus memory_get_usage() check

  • wp-includes/default-constants.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress
     
    3939                $blog_id = 1; 
    4040 
    4141        // set memory limits. 
    42         if ( function_exists('memory_get_usage') && ( (int) @ini_get('memory_limit') < abs(intval(WP_MEMORY_LIMIT)) ) ) 
    43                 @ini_set('memory_limit', WP_MEMORY_LIMIT); 
     42        if ( null !== ($current_limit = @ini_get('memory_limit')) ) { 
     43                if ( -1 != $current_limit && ( -1 == WP_MEMORY_LIMIT || ( inval( $current_limit ) < abs( intval( WP_MEMORY_LIMIT ) ) ) ) ) 
     44                        @ini_set('memory_limit', WP_MEMORY_LIMIT); 
     45        } 
    4446 
    4547        if ( !defined('WP_CONTENT_DIR') ) 
    4648                define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down