Fix handling of FormData in AjaxRequest
authorMatthias Schmidt <gravatronics@live.com>
Wed, 23 Sep 2015 16:10:29 +0000 (18:10 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 23 Sep 2015 16:10:29 +0000 (18:10 +0200)
wcfsetup/install/files/js/WoltLab/WCF/Ajax/Request.js

index 917c5d6986f163379238cefd774193ae697bb21b..aa8efafe037dea48faf18a59d1a9946a468b5806 100644 (file)
@@ -137,7 +137,7 @@ define(['Core', 'Language', 'Dom/ChangeListener', 'Dom/Util', 'Ui/Dialog', 'Wolt
                        
                        if (this._options.type === 'POST') {
                                var data = this._options.data;
-                               if (typeof data === 'object') {
+                               if (typeof data === 'object' && Core.getType(data) !== 'FormData') {
                                        data = Core.serialize(data);
                                }
                                
@@ -194,7 +194,7 @@ define(['Core', 'Language', 'Dom/ChangeListener', 'Dom/Util', 'Ui/Dialog', 'Wolt
                 * @param       {object<string, *>}     data    request data
                 */
                setData: function(data) {
-                       if (this._data !== null) {
+                       if (this._data !== null && Core.getType(data) !== 'FormData') {
                                data = Core.extend(this._data, data);
                        }