Admin: WYSIWYG: Add configuration setting 'ck_editor_block_image_copy_paste' to block image copy & paste creating a base64 image in HTML source (and ending up filling the database) - refs #3322
parent
06ea06e32e
commit
62f646c403
@ -0,0 +1,23 @@ |
||||
(function () { |
||||
|
||||
// register plugin
|
||||
CKEDITOR.plugins.add('blockimagepaste', { |
||||
|
||||
init: function (editor) { |
||||
|
||||
editor.on( 'paste', function(e) { |
||||
|
||||
var html = e.data.dataValue; |
||||
if (!html) return; |
||||
|
||||
// Replace data: images in Firefox and upload them
|
||||
e.data.dataValue = html.replace( /<img( [^>]*)?>/gi, function( img ) { |
||||
alert('Pasting images directly into the editor is not allowed. '); |
||||
return ''; |
||||
}); |
||||
}); |
||||
|
||||
} |
||||
}); |
||||
|
||||
})(); |
Loading…
Reference in new issue