From c26e1c0cc325e07510d890aae296e7db468dc0fd Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 5 Jan 2006 01:43:30 +0000 Subject: [PATCH] Handle quotes in upload titles. fixes #2198 git-svn-id: http://svn.automattic.com/wordpress/trunk@3398 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/inline-uploading.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/wp-admin/inline-uploading.php b/wp-admin/inline-uploading.php index 55b7a4265d..5b0c71f944 100644 --- a/wp-admin/inline-uploading.php +++ b/wp-admin/inline-uploading.php @@ -232,14 +232,15 @@ srcb[{$ID}] = '{$image['guid']}'; $xpadding = (128 - $image['uwidth']) / 2; $ypadding = (96 - $image['uheight']) / 2; $style .= "#target{$ID} img { padding: {$ypadding}px {$xpadding}px; }\n"; - $script .= "aa[{$ID}] = ''; -ab[{$ID}] = ''; -imga[{$ID}] = '\"{$image['post_title']}\"'; -imgb[{$ID}] = '\"{$image['post_title']}\"'; + $title = htmlentities($image['post_title'], ENT_QUOTES); + $script .= "aa[{$ID}] = ''; +ab[{$ID}] = ''; +imga[{$ID}] = '\"{$title}\"'; +imgb[{$ID}] = '\"{$title}\"'; "; $html .= "
- \"{$image['post_title']}\" + \"{$title}\"
{$noscript}
@@ -251,19 +252,19 @@ imgb[{$ID}] = '\"{$image['po "; } else { - $title = $attachment['post_title']; + $title = htmlentities($attachment['post_title'], ENT_QUOTES); $filename = basename($attachment['guid']); $icon = get_attachment_icon($ID); $toggle_icon = "
$__using_title"; - $script .= "aa[{$ID}] = '{$attachment['post_title']}'; -ab[{$ID}] = '{$attachment['post_title']}'; -title[{$ID}] = '{$attachment['post_title']}'; + $script .= "aa[{$ID}] = '{$title}'; +ab[{$ID}] = '{$title}'; +title[{$ID}] = '{$title}'; filename[{$ID}] = '{$filename}'; icon[{$ID}] = '{$icon}'; "; $html .= "
{$noscript}