]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/default-constants.php
Wordpress 3.7
[autoinstalls/wordpress.git] / wp-includes / default-constants.php
index 358c1018f33275566d61123488074bb9618376e6..bc6c79a80b382dfa3b6e0424a93872bab789e1f2 100644 (file)
@@ -41,7 +41,14 @@ function wp_initial_constants() {
        // set memory limits.
        if ( function_exists( 'memory_get_usage' ) ) {
                $current_limit = @ini_get( 'memory_limit' );
        // 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;
+               $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 < $wp_limit_int ) )
                        @ini_set( 'memory_limit', WP_MEMORY_LIMIT );
        }
 
                        @ini_set( 'memory_limit', WP_MEMORY_LIMIT );
        }