From aee8949c92b2e0a194e724fabe766be0a273f9b6 Mon Sep 17 00:00:00 2001 From: scambra Date: Fri, 8 Jun 2012 14:29:51 +0200 Subject: [PATCH] fix js success callback on safari when uploading files --- apps/files/js/files.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/files/js/files.js b/apps/files/js/files.js index aefd6f20be..9f71891abb 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -361,7 +361,8 @@ $(document).ready(function() { } }else{ data.submit().success(function(data, status) { - response = jQuery.parseJSON(data[0].body.innerText); + // in safari data is a string + response = jQuery.parseJSON(typeof data === 'string' ? data : data[0].body.innerText); if(response[0] != undefined && response[0].status == 'success') { var file=response[0]; delete uploadingFiles[file.name];