Commit 0761e710 authored by lechuck's avatar lechuck Committed by lucha

Update wordpress to 4.0.1

parent 4d189154
......@@ -9,7 +9,7 @@
<body>
<h1 id="logo">
<a href="https://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a>
<br /> Version 4.0
<br /> Version 4.0.1
</h1>
<p style="text-align: center">Semantic Personal Publishing Platform</p>
......
......@@ -41,6 +41,14 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
</a>
</h2>
<div class="changelog point-releases">
<h3><?php echo _n( 'Maintenance and Security Release', 'Maintenance and Security Releases', 1 ); ?></h3>
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 23 ), '4.0.1', number_format_i18n( 23 ) ); ?>
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://codex.wordpress.org/Version_4.0.1' ); ?>
</p>
</div>
<div class="changelog">
<div class="about-overview">
<?php if ( ( $locale = get_locale() ) && 'en_' === substr( $locale, 0, 3 ) ) : ?>
......
......@@ -273,7 +273,9 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
return;
}
if ( 'top' == $which ) { ?>
if ( 'top' == $which ) {
wp_referer_field();
?>
<div class="tablenav top">
<div class="alignleft actions">
<?php
......
......@@ -401,6 +401,12 @@ function wp_read_image_metadata( $file ) {
}
}
foreach ( $meta as &$value ) {
if ( is_string( $value ) ) {
$value = wp_kses_post( $value );
}
}
/**
* Filter the array of meta data read from an image's exif data.
*
......
......@@ -235,10 +235,15 @@ function install_plugins_favorites_form() {
function display_plugins_table() {
global $wp_list_table;
if ( current_filter() == 'install_plugins_favorites' && empty( $_GET['user'] ) && ! get_user_option( 'wporg_favorites' ) )
return;
if ( current_filter() == 'install_plugins_favorites' && empty( $_GET['user'] ) && ! get_user_option( 'wporg_favorites' ) ) {
return;
}
$wp_list_table->display();
?>
<form id="plugin-filter" action="" method="post">
<?php $wp_list_table->display(); ?>
</form>
<?php
}
add_action( 'install_plugins_search', 'display_plugins_table' );
add_action( 'install_plugins_popular', 'display_plugins_table' );
......
......@@ -1205,12 +1205,18 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
$return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button button-small" target="_blank">' . __('Change Permalinks') . "</a></span>\n";
}
} else {
if ( function_exists( 'mb_strlen' ) && mb_strlen( $post_name ) > 30 ) {
$post_name_abridged = mb_substr( $post_name, 0, 14 ) . '&hellip;' . mb_substr( $post_name, -14 );
} elseif ( strlen( $post_name ) > 30 ) {
$post_name_abridged = substr( $post_name, 0, 14 ) . '&hellip;' . substr( $post_name, -14 );
if ( function_exists( 'mb_strlen' ) ) {
if ( mb_strlen( $post_name ) > 30 ) {
$post_name_abridged = mb_substr( $post_name, 0, 14 ) . '&hellip;' . mb_substr( $post_name, -14 );
} else {
$post_name_abridged = $post_name;
}
} else {
$post_name_abridged = $post_name;
if ( strlen( $post_name ) > 30 ) {
$post_name_abridged = substr( $post_name, 0, 14 ) . '&hellip;' . substr( $post_name, -14 );
} else {
$post_name_abridged = $post_name;
}
}
$post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>';
......
......@@ -2,7 +2,7 @@
window.wp = window.wp || {};
jQuery( document ).ready( function($) {
jQuery( document ).ready( function( $ ) {
var $window = $( window ),
$document = $( document ),
$adminBar = $( '#wpadminbar' ),
......@@ -148,6 +148,11 @@ jQuery( document ).ready( function($) {
// We need to wait for TinyMCE to initialize.
$document.on( 'tinymce-editor-init.editor-expand', function( event, editor ) {
var hideFloatPanels = _.debounce( function() {
! $( '.mce-floatpanel:hover' ).length && tinymce.ui.FloatPanel.hideAll();
$( '.mce-tooltip' ).hide();
}, 1000, true );
// Make sure it's the main editor.
if ( editor.id !== 'content' ) {
return;
......@@ -224,6 +229,8 @@ jQuery( document ).ready( function($) {
// Adjust when switching editor modes.
function mceShow() {
$window.on( 'scroll.mce-float-panels', hideFloatPanels );
setTimeout( function() {
editor.execCommand( 'wpAutoResize' );
adjust();
......@@ -231,6 +238,8 @@ jQuery( document ).ready( function($) {
}
function mceHide() {
$window.off( 'scroll.mce-float-panels' );
setTimeout( function() {
var top = $contentWrap.offset().top;
......@@ -251,6 +260,8 @@ jQuery( document ).ready( function($) {
editor.on( 'hide', mceHide );
// Adjust when the editor resizes.
editor.on( 'setcontent wp-autoresize wp-toolbar-toggle', adjust );
$window.off( 'scroll.mce-float-panels' ).on( 'scroll.mce-float-panels', hideFloatPanels );
};
mceUnbind = function() {
......@@ -258,6 +269,8 @@ jQuery( document ).ready( function($) {
editor.off( 'show', mceShow );
editor.off( 'hide', mceHide );
editor.off( 'setcontent wp-autoresize wp-toolbar-toggle', adjust );
$window.off( 'scroll.mce-float-panels' );
};
if ( $wrap.hasClass( 'wp-editor-expand' ) ) {
......@@ -590,6 +603,12 @@ jQuery( document ).ready( function($) {
}
adjust();
}).on( 'wp-window-resized.editor-expand', function() {
if ( mceEditor && ! mceEditor.isHidden() ) {
mceEditor.execCommand( 'wpAutoResize' );
} else {
textEditorResize();
}
});
$textEditor.on( 'focus.editor-expand input.editor-expand propertychange.editor-expand', textEditorResize );
......
This diff is collapsed.
......@@ -72,11 +72,15 @@ var findPosts;
};
$( document ).ready( function() {
var $mediaGridWrap = $( '#wp-media-grid' );
// Open up a manage media frame into the grid.
wp.media && wp.media({
frame: 'manage',
container: $('#wpbody-content > .wrap')
}).open();
if ( $mediaGridWrap.length && window.wp && window.wp.media ) {
window.wp.media({
frame: 'manage',
container: $mediaGridWrap
}).open();
}
$( '#find-posts-submit' ).click( function( event ) {
if ( ! $( '#find-posts-response input[type="radio"]:checked' ).length )
......
var findPosts;!function(a){findPosts={open:function(b,c){var d=a(".ui-find-overlay");return 0===d.length&&(a("body").append('<div class="ui-find-overlay"></div>'),findPosts.overlay()),d.show(),b&&c&&a("#affected").attr("name",b).val(c),a("#find-posts").show(),a("#find-posts-input").focus().keyup(function(a){27==a.which&&findPosts.close()}),findPosts.send(),!1},close:function(){a("#find-posts-response").html(""),a("#find-posts").hide(),a(".ui-find-overlay").hide()},overlay:function(){a(".ui-find-overlay").on("click",function(){findPosts.close()})},send:function(){var b={ps:a("#find-posts-input").val(),action:"find_posts",_ajax_nonce:a("#_ajax_nonce").val()},c=a(".find-box-search .spinner");c.show(),a.ajax(ajaxurl,{type:"POST",data:b,dataType:"json"}).always(function(){c.hide()}).done(function(b){b.success||a("#find-posts-response").text(attachMediaBoxL10n.error),a("#find-posts-response").html(b.data)}).fail(function(){a("#find-posts-response").text(attachMediaBoxL10n.error)})}},a(document).ready(function(){wp.media&&wp.media({frame:"manage",container:a("#wpbody-content > .wrap")}).open(),a("#find-posts-submit").click(function(b){a('#find-posts-response input[type="radio"]:checked').length||b.preventDefault()}),a("#find-posts .find-box-search :input").keypress(function(a){return 13==a.which?(findPosts.send(),!1):void 0}),a("#find-posts-search").click(findPosts.send),a("#find-posts-close").click(findPosts.close),a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){"attach"===a(this).val()&&(b.preventDefault(),findPosts.open())})}),a(".find-box-inside").on("click","tr",function(){a(this).find(".found-radio input").prop("checked",!0)})})}(jQuery);
\ No newline at end of file
var findPosts;!function(a){findPosts={open:function(b,c){var d=a(".ui-find-overlay");return 0===d.length&&(a("body").append('<div class="ui-find-overlay"></div>'),findPosts.overlay()),d.show(),b&&c&&a("#affected").attr("name",b).val(c),a("#find-posts").show(),a("#find-posts-input").focus().keyup(function(a){27==a.which&&findPosts.close()}),findPosts.send(),!1},close:function(){a("#find-posts-response").html(""),a("#find-posts").hide(),a(".ui-find-overlay").hide()},overlay:function(){a(".ui-find-overlay").on("click",function(){findPosts.close()})},send:function(){var b={ps:a("#find-posts-input").val(),action:"find_posts",_ajax_nonce:a("#_ajax_nonce").val()},c=a(".find-box-search .spinner");c.show(),a.ajax(ajaxurl,{type:"POST",data:b,dataType:"json"}).always(function(){c.hide()}).done(function(b){b.success||a("#find-posts-response").text(attachMediaBoxL10n.error),a("#find-posts-response").html(b.data)}).fail(function(){a("#find-posts-response").text(attachMediaBoxL10n.error)})}},a(document).ready(function(){var b=a("#wp-media-grid");b.length&&window.wp&&window.wp.media&&window.wp.media({frame:"manage",container:b}).open(),a("#find-posts-submit").click(function(b){a('#find-posts-response input[type="radio"]:checked').length||b.preventDefault()}),a("#find-posts .find-box-search :input").keypress(function(a){return 13==a.which?(findPosts.send(),!1):void 0}),a("#find-posts-search").click(findPosts.send),a("#find-posts-close").click(findPosts.close),a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){"attach"===a(this).val()&&(b.preventDefault(),findPosts.open())})}),a(".find-box-inside").on("click","tr",function(){a(this).find(".found-radio input").prop("checked",!0)})})}(jQuery);
\ No newline at end of file
......@@ -24,8 +24,27 @@ if ( is_multisite() && ! is_network_admin() ) {
$wp_list_table = _get_list_table('WP_Plugin_Install_List_Table');
$pagenum = $wp_list_table->get_pagenum();
if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
$location = remove_query_arg( '_wp_http_referer', wp_unslash( $_SERVER['REQUEST_URI'] ) );
if ( ! empty( $_REQUEST['paged'] ) ) {
$location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location );
}
wp_redirect( $location );
exit;
}
$wp_list_table->prepare_items();
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
if ( $pagenum > $total_pages && $total_pages > 0 ) {
wp_redirect( add_query_arg( 'paged', $total_pages ) );
exit;
}
$title = __( 'Add Plugins' );
$parent_file = 'plugins.php';
......
......@@ -63,7 +63,7 @@ function press_it() {
// Error handling for media_sideload.
if ( is_wp_error($upload) ) {
wp_delete_post($post_ID);
wp_die($upload);
wp_die( esc_html( $upload->get_error_message() ) );
} else {
// Post formats.
if ( isset( $_POST['post_format'] ) ) {
......
......@@ -57,7 +57,7 @@ if ( 'grid' === $mode ) {
require_once( ABSPATH . 'wp-admin/admin-header.php' );
?>
<div class="wrap">
<div class="wrap" id="wp-media-grid">
<h2>
<?php
echo esc_html( $title );
......
......@@ -360,10 +360,6 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
else
unset($redirect['port']);
if ( ! empty( $user_home['scheme'] ) && $user_home['scheme'] === 'https' ) {
$redirect['scheme'] = 'https';
}
// trailing /index.php
$redirect['path'] = preg_replace('|/' . preg_quote( $wp_rewrite->index, '|' ) . '/*?$|', '/', $redirect['path']);
......@@ -421,7 +417,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
( strtolower($original['host']) != 'www.' . strtolower($redirect['host']) && 'www.' . strtolower($original['host']) != strtolower($redirect['host']) ) )
$redirect['host'] = $original['host'];
$compare_original = array( $original['scheme'], $original['host'], $original['path'] );
$compare_original = array( $original['host'], $original['path'] );
if ( !empty( $original['port'] ) )
$compare_original[] = $original['port'];
......@@ -429,7 +425,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
if ( !empty( $original['query'] ) )
$compare_original[] = $original['query'];
$compare_redirect = array( $redirect['scheme'], $redirect['host'], $redirect['path'] );
$compare_redirect = array( $redirect['host'], $redirect['path'] );
if ( !empty( $redirect['port'] ) )
$compare_redirect[] = $redirect['port'];
......
......@@ -214,6 +214,10 @@ class PasswordHash {
function HashPassword($password)
{
if ( strlen( $password ) > 4096 ) {
return '*';
}
$random = '';
if (CRYPT_BLOWFISH == 1 && !$this->portable_hashes) {
......@@ -249,6 +253,10 @@ class PasswordHash {
function CheckPassword($password, $stored_hash)
{
if ( strlen( $password ) > 4096 ) {
return false;
}
$hash = $this->crypt_private($password, $stored_hash);
if ($hash[0] == '*')
$hash = crypt($password, $stored_hash);
......
......@@ -7,6 +7,14 @@
box-sizing: content-box;
}
.media-frame input,
.media-frame select,
.media-frame textarea {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.media-modal,
.media-frame {
font-family: "Open Sans", sans-serif;
......@@ -56,9 +64,6 @@
.media-frame select {
font-family: "Open Sans", sans-serif;
font-size: 12px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-width: 1px;
border-style: solid;
border-color: #dfdfdf;
......
This diff is collapsed.
......@@ -7,6 +7,14 @@
box-sizing: content-box;
}
.media-frame input,
.media-frame select,
.media-frame textarea {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.media-modal,
.media-frame {
font-family: "Open Sans", sans-serif;
......@@ -56,9 +64,6 @@
.media-frame select {
font-family: "Open Sans", sans-serif;
font-size: 12px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-width: 1px;
border-style: solid;
border-color: #dfdfdf;
......
This diff is collapsed.
......@@ -28,7 +28,7 @@
* @return string The string replaced with html entities
*/
function wptexturize($text, $reset = false) {
global $wp_cockneyreplace;
global $wp_cockneyreplace, $shortcode_tags;
static $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements,
$default_no_texturize_tags, $default_no_texturize_shortcodes, $run_texturize = true;
......@@ -205,21 +205,34 @@ function wptexturize($text, $reset = false) {
// Look for shortcodes and HTML elements.
$tagnames = array_keys( $shortcode_tags );
$tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) );
$tagregexp = "(?:$tagregexp)(?![\\w-])"; // Excerpt of get_shortcode_regex().
$comment_regex =
'!' // Start of comment, after the <.
. '(?:' // Unroll the loop: Consume everything until --> is found.
. '-(?!->)' // Dash not followed by end of comment.
. '[^\-]*+' // Consume non-dashes.
. ')*+' // Loop possessively.
. '-->'; // End of comment.
$regex = '/(' // Capture the entire match.
. '<' // Find start of element.
. '(?(?=!--)' // Is this a comment?
. '.+?--\s*>' // Find end of comment
. $comment_regex // Find end of comment
. '|'
. '[^>]+>' // Find end of element
. ')'
. '|'
. '\[' // Find start of shortcode.
. '\[?' // Shortcodes may begin with [[
. '[\/\[]?' // Shortcodes may begin with [/ or [[
. $tagregexp // Only match registered shortcodes, because performance.
. '(?:'
. '[^\[\]<>]' // Shortcodes do not contain other shortcodes.
. '[^\[\]<>]+' // Shortcodes do not contain other shortcodes. Quantifier critical.
. '|'
. '<[^>]+>' // HTML elements permitted. Prevents matching ] before >.
. ')++'
. '<[^\[\]>]*>' // HTML elements permitted. Prevents matching ] before >.
. ')*+' // Possessive critical.
. '\]' // Find end of shortcode.
. '\]?' // Shortcodes may end with ]]
. ')/s';
......@@ -241,12 +254,12 @@ function wptexturize($text, $reset = false) {
continue;
} elseif ( '[' === $first && 1 === preg_match( '/^\[(?:[^\[\]<>]|<[^>]+>)++\]$/', $curl ) ) {
} elseif ( '[' === $first && 1 === preg_match( '/^\[\/?' . $tagregexp . '(?:[^\[\]<>]+|<[^\[\]>]*>)*+\]$/', $curl ) ) {
// This is a shortcode delimiter.
_wptexturize_pushpop_element( $curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes );
} elseif ( '[' === $first && 1 === preg_match( '/^\[\[?(?:[^\[\]<>]|<[^>]+>)++\]\]?$/', $curl ) ) {
} elseif ( '[' === $first && 1 === preg_match( '/^\[[\/\[]?' . $tagregexp . '(?:[^\[\]<>]+|<[^\[\]>]*>)*+\]\]?$/', $curl ) ) {
// This is an escaped shortcode delimiter.
// Do not texturize.
......
......@@ -444,8 +444,9 @@ function send_origin_headers() {
* @return mixed URL or false on failure.
*/
function wp_http_validate_url( $url ) {
$original_url = $url;
$url = wp_kses_bad_protocol( $url, array( 'http', 'https' ) );
if ( ! $url )
if ( ! $url || strtolower( $url ) !== strtolower( $original_url ) )
return false;
$parsed_url = @parse_url( $url );
......@@ -455,7 +456,7 @@ function wp_http_validate_url( $url ) {
if ( isset( $parsed_url['user'] ) || isset( $parsed_url['pass'] ) )
return false;
if ( false !== strpos( $parsed_url['host'], ':' ) )
if ( false !== strpbrk( $parsed_url['host'], ':#?[]' ) )
return false;
$parsed_home = @parse_url( get_option( 'home' ) );
......@@ -473,8 +474,7 @@ function wp_http_validate_url( $url ) {
}
if ( $ip ) {
$parts = array_map( 'intval', explode( '.', $ip ) );
if ( '127.0.0.1' === $ip
|| ( 10 === $parts[0] )
if ( 127 === $parts[0] || 10 === $parts[0]
|| ( 172 === $parts[0] && 16 <= $parts[1] && 31 >= $parts[1] )
|| ( 192 === $parts[0] && 168 === $parts[1] )
) {
......
......@@ -577,10 +577,11 @@
return ( this.getCurrentIndex() - 1 ) > -1;
},
/**
* Respond to the keyboard events: right arrow, left arrow, escape.
* Respond to the keyboard events: right arrow, left arrow, except when
* focus is in a textarea or input field.
*/
keyEvent: function( event ) {
if ( 'INPUT' === event.target.tagName && ! ( event.target.readOnly || event.target.disabled ) ) {
if ( ( 'INPUT' === event.target.nodeName || 'TEXTAREA' === event.target.nodeName ) && ! ( event.target.readOnly || event.target.disabled ) ) {
return;
}
......
This diff is collapsed.
......@@ -5850,7 +5850,7 @@
controller: this.controller,
priority: -60,
click: function() {
var model, changed = [], self = this,
var changed = [], removed = [], self = this,
selection = this.controller.state().get( 'selection' ),
library = this.controller.state().get( 'library' );
......@@ -5869,22 +5869,28 @@
return;
}
while ( selection.length > 0 ) {
model = selection.at( 0 );
selection.each( function( model ) {
if ( ! model.get( 'nonces' )['delete'] ) {
removed.push( model );
return;
}
if ( media.view.settings.mediaTrash && 'trash' === model.get( 'status' ) ) {
model.set( 'status', 'inherit' );
changed.push( model.save() );
selection.remove( model );
removed.push( model );
} else if ( media.view.settings.mediaTrash ) {
model.set( 'status', 'trash' );
changed.push( model.save() );
selection.remove( model );
removed.push( model );
} else {
model.destroy();
}
}
} );
if ( changed.length ) {
selection.remove( removed );
$.when.apply( null, changed ).then( function() {
library._requery( true );
self.controller.trigger( 'selection:action:done' );
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -384,10 +384,10 @@ function edButton(id, display, tagStart, tagEnd, access) {
canvas.value = text.substring(0, startPos) + content + text.substring(endPos, text.length);
canvas.focus();
canvas.selectionStart = startPos + content.length;
canvas.selectionEnd = startPos + content.length;
canvas.scrollTop = scrollTop;
canvas.focus();
} else {
canvas.value += content;
canvas.focus();
......@@ -509,10 +509,10 @@ function edButton(id, display, tagStart, tagEnd, access) {
}
}
canvas.focus();
canvas.selectionStart = cursorPos;
canvas.selectionEnd = cursorPos;
canvas.scrollTop = scrollTop;
canvas.focus();
} else { // other browsers?
if ( !endTag ) {
canvas.value += t.tagStart;
......
This diff is collapsed.
/* global tinymce */
tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
var toolbarActive = false,
var serializer,
toolbarActive = false,
editingImage = false;
function parseShortcode( content ) {
......@@ -82,7 +83,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
return '';
}
out = b.replace( /<dl ([^>]+)>\s*<dt [^>]+>([\s\S]+?)<\/dt>\s*<dd [^>]+>([\s\S]*?)<\/dd>\s*<\/dl>/gi, function( a, b, c, caption ) {
out = b.replace( /\s*<dl ([^>]+)>\s*<dt [^>]+>([\s\S]+?)<\/dt>\s*<dd [^>]+>([\s\S]*?)<\/dd>\s*<\/dl>\s*/gi, function( a, b, c, caption ) {
var id, classes, align, width;
width = c.match( /width="([0-9]*)"/ );
......@@ -116,7 +117,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
return '[caption id="' + id + '" align="' + align + '" width="' + width + '"' + classes + ']' + c + ' ' + caption + '[/caption]';
});
if ( out.indexOf('[caption') !== 0 ) {
if ( out.indexOf('[caption') === -1 ) {
// the caption html seems broken, try to find the image that may be wrapped in a link
// and may be followed by <p> with the caption text.
out = b.replace( /[\s\S]*?((?:<a [^>]+>)?<img [^>]+>(?:<\/a>)?)(<p>[\s\S]*<\/p>)?[\s\S]*/gi, '<p>$1</p>$2' );
......@@ -226,6 +227,19 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
return node && !! ( node.textContent || node.innerText );
}
// Verify HTML in captions
function verifyHTML( caption ) {
if ( ! caption || ( caption.indexOf( '<' ) === -1 && caption.indexOf( '>' ) === -1 ) ) {
return caption;
}
if ( ! serializer ) {
serializer = new tinymce.html.Serializer( {}, editor.schema );
}
return serializer.serialize( editor.parser.parse( caption, { forced_root_block: false } ) );
}
function updateImage( imageNode, imageData ) {
var classes, className, node, html, parent, wrap, linkNode,
captionNode, dd, dl, id, attrs, linkAttrs, width, height, align,
......@@ -303,6 +317,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
}
if ( imageData.caption ) {
imageData.caption = verifyHTML( imageData.caption );
id = imageData.attachment_id ? 'attachment_' + imageData.attachment_id : null;
align = 'align' + ( imageData.align || 'none' );
......@@ -645,6 +660,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
// Convert remaining line breaks to <br>
caption = caption.replace( /(<br[^>]*>)\s*\n\s*/g, '$1' ).replace( /\s*\n\s*/g, '<br />' );
caption = verifyHTML( caption );
}
if ( ! imgNode ) {
......
......@@ -12,7 +12,7 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
firstFocus = true,
_noop = function() { return false; },
isios = /iPad|iPod|iPhone/.test( navigator.userAgent ),
cursorInterval, lastKeyDownNode, setViewCursorTries, focus, execCommandView;
cursorInterval, lastKeyDownNode, setViewCursorTries, focus, execCommandView, execCommandBefore;
function getView( node ) {
return getParent( node, 'wpview-wrap' );
......@@ -368,7 +368,7 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
// Ref: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent.keyCode
function isSpecialKey( key ) {
return ( ( key <= 47 && key !== VK.SPACEBAR && key !== VK.ENTER && key !== VK.DELETE && key !== VK.BACKSPACE && ( key < 37 || key > 40 ) ) ||
key >= 224 || // OEM or non-printable
key >= 224 || // OEM or non-printable