From 2daef7c7dcacc4b0bf6fc650d0d3ef330db11eee Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 28 May 2015 15:36:28 +0200 Subject: [PATCH] Fallback to picture preview for IE <= 9 IE 9 and below do not provide window.btoa and there is currently no way to generate base64 strings without introducting further dependencies. So for now the solution is to fall back to the ugly picture mode for text files whenever IE <= 9 is used. --- apps/files_sharing/js/public.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index c5934a4f60..17bee7b3b6 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -110,7 +110,7 @@ OCA.Sharing.PublicApp = { (maxGifSize === -1 || fileSize <= (maxGifSize * 1024 * 1024))) { img.attr('src', $('#downloadURL').val()); img.appendTo('#imgframe'); - } else if (mimetype.substr(0, mimetype.indexOf('/')) === 'text') { + } else if (mimetype.substr(0, mimetype.indexOf('/')) === 'text' && window.btoa) { // Undocumented Url to public WebDAV endpoint var url = parent.location.protocol + '//' + location.host + OC.linkTo('', 'public.php/webdav'); $.ajax({