Make WordPress Core

Changeset 37592


Ignore:
Timestamp:
05/30/2016 02:13:57 AM (10 years ago)
Author:
DrewAPicture
Message:

Docs: Ensure hook and duplicate hook docs directly precede all instances of the image_memory_limit filter.

Hook docs must directly precede hooks in order for the Code Reference parser to correctly identify them as such.

Fixes #36968.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-image-editor-gd.php

    r37492 r37592  
    105105                 *                          Accepts an integer (bytes), or a shorthand string notation, such as '256M'.
    106106                 */
    107                 // Set artificially high because GD uses uncompressed images in memory
    108                 @ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) );
     107                $image_memory_limit = apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT );
     108
     109                // Set artificially high because GD uses uncompressed images in memory.
     110                @ini_set( 'memory_limit', $image_memory_limit );
    109111
    110112                $this->image = @imagecreatefromstring( file_get_contents( $this->file ) );
  • trunk/src/wp-includes/class-wp-image-editor-imagick.php

    r37591 r37592  
    139139
    140140                /** This filter is documented in wp-includes/class-wp-image-editor-gd.php */
    141                 // Even though Imagick uses less PHP memory than GD, set higher limit for users that have low PHP.ini limits
    142                 @ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) );
     141                $image_memory_limit = apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT );
     142
     143                /*
     144                 * Even though Imagick uses less PHP memory than GD, set higher limit
     145                 * for users that have low PHP.ini limits.
     146                 */
     147                @ini_set( 'memory_limit', $image_memory_limit );
    143148
    144149                try {
  • trunk/src/wp-includes/deprecated.php

    r37542 r37592  
    31763176                return __('The GD image library is not installed.');
    31773177
    3178         // Set artificially high because GD uses uncompressed images in memory
    3179         @ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) );
     3178        /** This filter is documented in wp-includes/class-wp-image-editor-gd.php */
     3179        $image_memory_limit = apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT );
     3180
     3181        // Set artificially high because GD uses uncompressed images in memory.
     3182        @ini_set( 'memory_limit', $image_memory_limit );
     3183
    31803184        $image = imagecreatefromstring( file_get_contents( $file ) );
    31813185
Note: See TracChangeset for help on using the changeset viewer.