Allow upload of arbitrary files unknown to the browser
authorAlexander Ebert <ebert@woltlab.com>
Sun, 11 Jan 2015 21:30:52 +0000 (22:30 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 11 Jan 2015 21:30:52 +0000 (22:30 +0100)
Some files are not properly recognized by the browser, in my tests at least ".eot" resulted in an empty Blob.type in Chrome. Since this can happen with other types and browsers, we'll ignore this now.

wcfsetup/install/files/js/3rdParty/redactor/plugins/wupload.js

index 16a2a4402aedc3d25d575395085426751265e090..2913c6d32c10714fa6fd0b1c7d0f1f891bb2e3ca 100644 (file)
@@ -185,10 +185,7 @@ RedactorPlugins.wupload = function() {
                                this.wupload._revertDropArea(undefined, $containerID);
                                
                                for (var $i = 0; $i < event.dataTransfer.files.length; $i++) {
-                                       var $file = event.dataTransfer.files[$i];
-                                       if ($file.type) {
-                                               WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'upload_' + $containerID, { file: $file });
-                                       }
+                                       WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'upload_' + $containerID, { file: event.dataTransfer.files[$i] });
                                }
                        }
                },