From 73c3aa15f59492c0a105b4a5c16392918a6c898c Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Mon, 8 Nov 2010 17:15:14 +0000 Subject: [PATCH] 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 --- wp-admin/includes/media.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 5ead282a13..ad1728b732 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -140,6 +140,11 @@ function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $ $width = $matches[1]; + $caption = str_replace( array( '>', '<', '"', "'" ), + array( '>', '<', '"', ''' ), + $caption + ); + $html = preg_replace( '/(class=["\'][^\'"]*)align(none|left|right|center)\s?/', '$1', $html ); if ( empty($align) ) $align = 'none';