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

git-svn-id: http://svn.automattic.com/wordpress/trunk@16236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2010-11-08 17:15:14 +00:00
parent 3d8f4b6b2e
commit 136df0f262
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';