Fix quotes in captions. Props azaozz. see #6812

git-svn-id: http://svn.automattic.com/wordpress/trunk@8290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-07-08 23:38:53 +00:00
parent 8a37dfa5b2
commit 3b48af4a6d
8 changed files with 19 additions and 20 deletions

View File

@ -145,7 +145,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
{ "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311b" },
{ "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" }, { "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=311" },
@ -158,7 +158,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
{ "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311b" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/wordpress.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/wordpress.css?ver=311" },

View File

@ -1124,17 +1124,9 @@ function wp_richedit_pre($text) {
// Filtering a blank results in an annoying <br />\n // Filtering a blank results in an annoying <br />\n
if ( empty($text) ) return apply_filters('richedit_pre', ''); if ( empty($text) ) return apply_filters('richedit_pre', '');
$output = $text; $output = convert_chars($text);
$output = convert_chars($output);
$output = wpautop($output); $output = wpautop($output);
$output = htmlspecialchars($output, ENT_NOQUOTES);
// These must be double-escaped or planets will collide.
$output = str_replace('&lt;', '&amp;lt;', $output);
$output = str_replace('&gt;', '&amp;gt;', $output);
// These should be entities too
$output = str_replace('<', '&lt;', $output);
$output = str_replace('>', '&gt;', $output);
return apply_filters('richedit_pre', $output); return apply_filters('richedit_pre', $output);
} }

View File

@ -434,7 +434,8 @@ s100:"' . mce_escape( __('100%') ) . '",
s110:"' . mce_escape( __('110%') ) . '", s110:"' . mce_escape( __('110%') ) . '",
s120:"' . mce_escape( __('120%') ) . '", s120:"' . mce_escape( __('120%') ) . '",
s130:"' . mce_escape( __('130%') ) . '", s130:"' . mce_escape( __('130%') ) . '",
caption:"' . mce_escape( __('Caption') ) . '" img_title:"' . mce_escape( __('Edit Image Title') ) . '",
caption:"' . mce_escape( __('Edit Image Caption') ) . '"
}); });
'; ';
?> ?>

View File

@ -62,6 +62,10 @@ th.label {
width: 107px; width: 107px;
} }
#media-upload #basic th.label {
padding: 5px 5px 5px 0;
}
.show-align { .show-align {
height: 200px; height: 200px;
width: 480px; width: 480px;

View File

@ -7,7 +7,7 @@
<script type="text/javascript" src="js/editimage.js?ver=311"></script> <script type="text/javascript" src="js/editimage.js?ver=311"></script>
<script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script> <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
<link rel="stylesheet" href="css/editimage.css?ver=311" type="text/css" media="all" /> <link rel="stylesheet" href="css/editimage.css?ver=311b" type="text/css" media="all" />
<link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-beta1" type="text/css" media="all" /> <link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-beta1" type="text/css" media="all" />
<script type="text/javascript"> <script type="text/javascript">
if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') ) if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') )
@ -77,8 +77,7 @@ if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') )
<tr class=""> <tr class="">
<th valign="top" scope="row" class="label"> <th valign="top" scope="row" class="label">
<label for="img_title"> <label for="img_title">
<span class="alignleft">{#advanced_dlg.link_titlefield}</span> <span class="alignleft">{#wpeditimage.img_title}</span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</label> </label>
</th> </th>
<td class="field"> <td class="field">

View File

@ -15,7 +15,7 @@
if ( ed.dom.getAttrib(el, 'class').indexOf('mceItem') != -1 || el.nodeName != 'IMG' ) if ( ed.dom.getAttrib(el, 'class').indexOf('mceItem') != -1 || el.nodeName != 'IMG' )
return; return;
tb_show('', url + '/editimage.html?TB_iframe=true'); tb_show('', url + '/editimage.html?ver=311b&TB_iframe=true');
tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
}); });
@ -74,6 +74,8 @@
_do_shcode : function(co) { _do_shcode : function(co) {
return co.replace(/\[wp_caption([^\]]+)\]([\s\S]+?)\[\/wp_caption\][\s\u00a0]*/g, function(a,b,c){ return co.replace(/\[wp_caption([^\]]+)\]([\s\S]+?)\[\/wp_caption\][\s\u00a0]*/g, function(a,b,c){
b = b.replace(/\\'|\\&#39;|\\&#039;/g, '&#39;').replace(/\\"|\\&quot;/g, '&quot;');
c = c.replace(/\\&#39;|\\&#039;/g, '&#39;').replace(/\\&quot;/g, '&quot;');
var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/align=['"]([^'"]+)/i); var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/align=['"]([^'"]+)/i);
var w = b.match(/width=['"]([0-9]+)/), cap = b.match(/caption=['"]([^'"]+)/i); var w = b.match(/width=['"]([0-9]+)/), cap = b.match(/caption=['"]([^'"]+)/i);
@ -91,7 +93,7 @@
}, },
_get_shcode : function(co) { _get_shcode : function(co) {
return co.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>([^<]+)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi, function(a,b,c,cap){ return co.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi, function(a,b,c,cap){
var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/class=['"]([^'"]+)/i); var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/class=['"]([^'"]+)/i);
var w = c.match(/width=['"]([0-9]+)/); var w = c.match(/width=['"]([0-9]+)/);
@ -101,6 +103,7 @@
if ( ! w || ! cap ) return c; if ( ! w || ! cap ) return c;
cls = cls.match(/align[^ '"]+/) || 'alignnone'; cls = cls.match(/align[^ '"]+/) || 'alignnone';
cap = cap.replace(/<\S[^<>]*>/gi, '').replace(/'/g, '&#39;').replace(/"/g, '&quot;');
return '[wp_caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/wp_caption]'; return '[wp_caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/wp_caption]';
}); });

View File

@ -222,7 +222,7 @@ if ( $compress && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
// Setup cache info // Setup cache info
if ( $disk_cache ) { if ( $disk_cache ) {
$cacheKey = apply_filters('tiny_mce_version', '20080706'); $cacheKey = apply_filters('tiny_mce_version', '20080708');
foreach ( $initArray as $v ) foreach ( $initArray as $v )
$cacheKey .= $v; $cacheKey .= $v;

View File

@ -37,7 +37,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080706' ); $scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080706' );
// Modify this version when tinyMCE plugins are changed. // Modify this version when tinyMCE plugins are changed.
$mce_version = apply_filters('tiny_mce_version', '20080706'); $mce_version = apply_filters('tiny_mce_version', '20080708');
$scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version ); $scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version );
$scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6'); $scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');