Encode quotes and chevrons in the HTML editor version of the generated captions too. Fixes #15343.

git-svn-id: https://develop.svn.wordpress.org/trunk@16236 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2010-11-08 17:15:14 +00:00
parent baaf0585dd
commit 73c3aa15f5
1 changed files with 5 additions and 0 deletions

View File

@ -140,6 +140,11 @@ function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $
$width = $matches[1];
$caption = str_replace( array( '>', '<', '"', "'" ),
array( '&gt;', '&lt;', '&quot;', '&#039;' ),
$caption
);
$html = preg_replace( '/(class=["\'][^\'"]*)align(none|left|right|center)\s?/', '$1', $html );
if ( empty($align) )
$align = 'none';