Make WordPress Core


Ignore:
Timestamp:
10/03/2013 03:27:04 AM (11 years ago)
Author:
nacin
Message:

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

props peterjaap.
fixes #23251.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-constants.php

    r23529 r25684  
    4242    if ( function_exists( 'memory_get_usage' ) ) {
    4343        $current_limit = @ini_get( 'memory_limit' );
    44         if ( -1 != $current_limit && ( -1 == WP_MEMORY_LIMIT || ( intval( $current_limit ) < abs( intval( WP_MEMORY_LIMIT ) ) ) ) )
     44        $current_limit_int = intval( $current_limit );
     45        if ( false !== stripos( $current_limit, 'G' ) )
     46            $current_limit_int *= 1024;
     47
     48        if ( -1 != $current_limit && ( -1 == WP_MEMORY_LIMIT || ( $current_limit_int < abs( intval( WP_MEMORY_LIMIT ) ) ) ) )
    4549            @ini_set( 'memory_limit', WP_MEMORY_LIMIT );
    4650    }
Note: See TracChangeset for help on using the changeset viewer.