Make WordPress Core

Ticket #52826: 52826.4.diff

File 52826.4.diff, 1.5 KB (added by terriann, 5 years ago)

There is one place where a second parameter is being passed to wp_getimagesize() but that $info variable is never initialized which lead to problems parsing EXIF data into the caption field

  • wp-admin/includes/image.php

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

     
    49754975 *
    49764976 * @since 5.7.0
    49774977 *
    4978  * @param string $filename  The file path.
    4979  * @param array  $imageinfo Extended image information, passed by reference.
     4978 * @param string $filename   The file path.
     4979 * @param array  $image_info Optional. Extended image information (passed by reference).
    49804980 * @return array|false Array of image information or false on failure.
    49814981 */
    4982 function wp_getimagesize( $filename, &$imageinfo = array() ) {
     4982function wp_getimagesize( $filename, array &$image_info = null ) {
    49834983        if (
    49844984                // Skip when running unit tests.
    49854985                ! defined( 'WP_RUN_CORE_TESTS' )
     
    49874987                // Return without silencing errors when in debug mode.
    49884988                defined( 'WP_DEBUG' ) && WP_DEBUG
    49894989        ) {
    4990                 return getimagesize( $filename, $imageinfo );
     4990                return getimagesize( $filename, $image_info );
    49914991        }
    49924992
    49934993        /*
     
    50015001         *
    50025002         * phpcs:ignore WordPress.PHP.NoSilencedErrors
    50035003         */
    5004         return @getimagesize( $filename, $imageinfo );
     5004        return @getimagesize( $filename, $image_info );
    50055005}