WordPress.org

Make WordPress Core

Ticket #8763: wp-includes_media.php.patch

File wp-includes_media.php.patch, 812 bytes (added by miqrogroove, 9 years ago)

Patch to correct the raw output of $attachment->post_excerpt in the wp-includes/media.php file function gallery_shortcode()

  • media.php

     
    662662        foreach ( $attachments as $id => $attachment ) {
    663663                $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);
    664664
     665                $caption_cdata = wp_specialchars($attachment->post_excerpt);
     666
    665667                $output .= "<{$itemtag} class='gallery-item'>";
    666668                $output .= "
    667669                        <{$icontag} class='gallery-icon'>
     
    670672                if ( $captiontag && trim($attachment->post_excerpt) ) {
    671673                        $output .= "
    672674                                <{$captiontag} class='gallery-caption'>
    673                                 {$attachment->post_excerpt}
     675                                {$caption_cdata}
    674676                                </{$captiontag}>";
    675677                }
    676678                $output .= "</{$itemtag}>";