Make WordPress Core

Changeset 17749


Ignore:
Timestamp:
04/28/2011 04:25:36 PM (13 years ago)
Author:
westi
Message:

Introduce WP_MAX_MEMORY_LIMIT constant for the high memory limit we set when image processing and unzipping.
Ensure it is always filterable by plugins as well as configurable in wp-config
Fixes #13847 props hakre

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin.php

    r17748 r17749  
    107107
    108108if ( current_user_can( 'manage_options' ) )
    109     @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', '256M' ) );
     109    @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
    110110
    111111do_action('admin_init');
  • trunk/wp-admin/includes/file.php

    r17693 r17749  
    519519
    520520    // Unzip can use a lot of memory, but not this much hopefully
    521     @ini_set('memory_limit', '256M');
     521    @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
    522522
    523523    $needed_dirs = array();
  • trunk/wp-admin/includes/image-edit.php

    r17603 r17749  
    392392function stream_preview_image($post_id) {
    393393    $post = get_post($post_id);
    394     @ini_set('memory_limit', '256M');
     394    @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
    395395    $img = load_image_to_edit( $post_id, $post->post_mime_type, array(400, 400) );
    396396
     
    497497    $success = $delete = $scaled = $nocrop = false;
    498498    $post = get_post($post_id);
    499     @ini_set('memory_limit', '256M');
     499    @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
    500500    $img = load_image_to_edit($post_id, $post->post_mime_type);
    501501
  • trunk/wp-includes/default-constants.php

    r17745 r17749  
    2525    }
    2626
     27    if ( ! defined( 'WP_MAX_MEMORY_LIMIT' ) ) {
     28        define( 'WP_MAX_MEMORY_LIMIT', '256M' );
     29    }
     30
    2731    /**
    2832     * The $blog_id global, which you can change in the config allows you to create a simple
  • trunk/wp-includes/media.php

    r17631 r17749  
    251251
    252252    // Set artificially high because GD uses uncompressed images in memory
    253     @ini_set('memory_limit', '256M');
     253    @ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) );
    254254    $image = imagecreatefromstring( file_get_contents( $file ) );
    255255
  • trunk/wp-settings.php

    r17727 r17749  
    2121require( ABSPATH . WPINC . '/version.php' );
    2222
    23 // Set initial default constants including WP_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
     23// Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
    2424wp_initial_constants( );
    2525
Note: See TracChangeset for help on using the changeset viewer.