From 18e6cc9cb6c655c5ef32b07fa7cf764d7821b94f Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Tue, 19 Nov 2019 02:33:50 +0000 Subject: [PATCH] Fix that text copied from some applications such as MS Office and LibreOffice is pasted as an image in addition to plain text (#32469, #3816). Patch by Takenori TAKAKI. git-svn-id: http://svn.redmine.org/redmine/trunk@19089 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- public/javascripts/attachments.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index b856ff415..4a33daf55 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -255,6 +255,7 @@ function copyImageFromClipboard(e) { if (!$(e.target).hasClass('wiki-edit')) { return; } var clipboardData = e.clipboardData || e.originalEvent.clipboardData if (!clipboardData) { return; } + if (clipboardData.types.some(t => /^text/.test(t))) { return; } var items = clipboardData.items for (var i = 0 ; i < items.length ; i++) { -- 2.39.5