Prevent Chromium browser form injecting base64 encoded images
authorAlexander Ebert <ebert@woltlab.com>
Thu, 9 Jul 2020 19:08:44 +0000 (21:08 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 9 Jul 2020 19:08:44 +0000 (21:08 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabPaste.js

index 06dc4802cf313a66b8c1a5d238521e1f84f90a44..8f9434bab5de72c329e5097e1fcc8ab7a63802c8 100644 (file)
@@ -260,6 +260,11 @@ $.Redactor.prototype.WoltLabPaste = function() {
                                                                return false;
                                                        }
                                                }
+                                               else if (this.detect.isWebkit() && clipboard.items.length === 1) {
+                                                       // Newer Chromium based browsers will paste the base64 encoded
+                                                       // image along with the provided File object.
+                                                       e.preventDefault();
+                                               }
                                        }
                                }