Make WordPress Core

Ticket #52826: 52826.5.diff

File 52826.5.diff, 1.4 KB (added by terriann, 5 years ago)

Addressing consistency in parameter count passed through to getimagesize() when compared to 5.6.2

  • src/wp-admin/includes/image.php

     
    711711        );
    712712
    713713        $iptc = array();
    714         $info = array();
    715714        /*
    716715         * Read IPTC first, since it might contain data not available in exif such
    717716         * as caption, description etc.
  • src/wp-includes/media.php

     
    49874987                // Return without silencing errors when in debug mode.
    49884988                defined( 'WP_DEBUG' ) && WP_DEBUG
    49894989        ) {
    4990                 return getimagesize( $filename, $image_info );
     4990                if ( 2 === func_num_args() ) {
     4991                        return getimagesize( $filename, $image_info );
     4992                } else {
     4993                        return getimagesize( $filename );
     4994                }
    49914995        }
    49924996
    49934997        /*
     
    49985002         * even when it's able to provide image size information.
    49995003         *
    50005004         * See https://core.trac.wordpress.org/ticket/42480
    5001          *
    5002          * phpcs:ignore WordPress.PHP.NoSilencedErrors
    50035005         */
    5004         return @getimagesize( $filename, $image_info );
     5006        if ( 2 === func_num_args() ) {
     5007                // phpcs:ignore WordPress.PHP.NoSilencedErrors
     5008                return @getimagesize( $filename, $image_info );
     5009        } else {
     5010                // phpcs:ignore WordPress.PHP.NoSilencedErrors
     5011                return @getimagesize( $filename );
     5012        }
    50055013}