diff --git a/wp-includes/media.php b/wp-includes/media.php index a7635babf8..ee11a41f29 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -684,7 +684,7 @@ function gallery_shortcode($attr) { if ( $captiontag && trim($attachment->post_excerpt) ) { $output .= " <{$captiontag} class='gallery-caption'> - {$attachment->post_excerpt} + " . wp_specialchars($attachment->post_excerpt) . " "; } $output .= "";