WordPress.org

Make WordPress Core

Ticket #23733: 23733.diff

File 23733.diff, 817 bytes (added by wonderboymusic, 2 years ago)

Fixes another instance

  • wp-includes/media.php

    diff --git wp-includes/media.php wp-includes/media.php
    index f41f63e..5f6efc1 100644
    function gallery_shortcode($attr) { 
    780780        foreach ( $attachments as $id => $attachment ) { 
    781781                $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false); 
    782782                $image_meta  = wp_get_attachment_metadata( $id ); 
    783                 $orientation = ( $image_meta['height'] > $image_meta['width'] ) ? 'portrait' : 'landscape'; 
     783 
     784                $orientation = ''; 
     785                if ( isset( $image_meta['height'] ) && isset( $image_meta['width'] ) ) 
     786                        $orientation = ( $image_meta['height'] > $image_meta['width'] ) ? 'portrait' : 'landscape'; 
    784787 
    785788                $output .= "<{$itemtag} class='gallery-item'>"; 
    786789                $output .= "