From e2a4417079c2ddd1263ec9af2d2930eb65e911f7 Mon Sep 17 00:00:00 2001
From: Vincent Petry <pvince81@owncloud.com>
Date: Thu, 10 Oct 2013 15:54:00 +0200
Subject: [PATCH] Fixed conflict dialog in IE8

- Fixed JS error that prevent the conflict dialog to open #5060
- Fixed JS error that prevented the overwrite case to run
---
 apps/files/js/file-upload.js | 6 +++++-
 core/js/oc-dialogs.js        | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index f1ef485fc3..eb42d604ed 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -124,7 +124,11 @@ OC.Upload = {
 	 */
 	onReplace:function(data){
 		this.log('replace', null, data);
-		data.data.append('resolution', 'replace');
+		if (data.data){
+			data.data.append('resolution', 'replace');
+		} else {
+			data.formData.push({name:'resolution',value:'replace'}); //hack for ie8
+		}
 		data.submit();
 	},
 	/**
diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js
index e5e9f6dbb7..a9b40918ca 100644
--- a/core/js/oc-dialogs.js
+++ b/core/js/oc-dialogs.js
@@ -234,7 +234,7 @@ var OCdialogs = {
 		var getCroppedPreview = function(file) {
 			var deferred = new $.Deferred();
 			// Only process image files.
-			var type = file.type.split('/').shift();
+			var type = file.type && file.type.split('/').shift();
 			if (window.FileReader && type === 'image') {
 				var reader = new FileReader();
 				reader.onload = function (e) {
-- 
GitLab