Built from https://develop.svn.wordpress.org/trunk@29570


git-svn-id: http://core.svn.wordpress.org/trunk@29344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-08-21 23:53:18 +00:00
parent 0eed9373e2
commit c3c20549c5
7 changed files with 69 additions and 15 deletions

View File

@ -144,7 +144,7 @@ tinymce.PluginManager.add('media', function(editor, url) {
};
function updateValueOnChange() {
data = htmlToData( this.value() );
data = htmlToData(this.value());
this.parent().parent().fromJSON(data);
}
@ -381,6 +381,56 @@ tinymce.PluginManager.add('media', function(editor, url) {
return {};
}
function sanitize(html) {
if (editor.settings.media_filter_html === false) {
return html;
}
var writer = new tinymce.html.Writer();
new tinymce.html.SaxParser({
validate: false,
allow_conditional_comments: false,
special: 'script,noscript',
comment: function(text) {
writer.comment(text);
},
cdata: function(text) {
writer.cdata(text);
},
text: function(text, raw) {
writer.text(text, raw);
},
start: function(name, attrs, empty) {
if (name == 'script' || name == 'noscript') {
return;
}
for (var i = 0; i < attrs.length; i++) {
if (attrs[i].name.indexOf('on') === 0) {
return;
}
}
writer.start(name, attrs, empty);
},
end: function(name) {
if (name == 'script' || name == 'noscript') {
return;
}
writer.end(name);
}
}, new tinymce.html.Schema({})).parse(html);
return writer.getContent();
}
function updateHtml(html, data, updateAll) {
var writer = new tinymce.html.Writer();
var sourceCount = 0, hasImage;
@ -674,7 +724,7 @@ tinymce.PluginManager.add('media', function(editor, url) {
if (innerHtml) {
innerNode = new tinymce.html.Node('#text', 3);
innerNode.raw = true;
innerNode.value = unescape(innerHtml);
innerNode.value = sanitize(unescape(innerHtml));
realElm.append(innerNode);
}

File diff suppressed because one or more lines are too long

View File

@ -620,8 +620,12 @@ define("tinymce/pasteplugin/Clipboard", [
});
editor.on('paste', function(e) {
// Getting content from the Clipboard can take some time
var clipboardTimer = new Date().getTime();
var clipboardContent = getClipboardContent(e);
var isKeyBoardPaste = new Date().getTime() - keyboardPasteTimeStamp < 1000;
var clipboardDelay = new Date().getTime() - clipboardTimer;
var isKeyBoardPaste = (new Date().getTime() - keyboardPasteTimeStamp - clipboardDelay) < 1000;
var plainTextMode = self.pasteFormat == "text" || keyboardPastePlainTextState;
keyboardPastePlainTextState = false;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -18,7 +18,7 @@ $wp_db_version = 29188;
*
* @global string $tinymce_version
*/
$tinymce_version = '4103-20140809';
$tinymce_version = '4104-20140821';
/**
* Holds the required PHP version