Disabled file preview for SVG

Security improvement (kudos to Sergey Belov, https://sergeybelove.ru)
This commit is contained in:
Igor Zhukov 2015-11-11 13:42:18 +03:00
parent 89146e7ac8
commit 812801c752

View File

@ -1856,7 +1856,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
var doc = angular.copy(docs[docID]), var doc = angular.copy(docs[docID]),
isGif = doc.mime_type == 'image/gif', isGif = doc.mime_type == 'image/gif',
isSticker = doc.mime_type.substr(0, 6) == 'image/' && doc.sticker, isSticker = doc.mime_type == 'image/webp' && doc.sticker,
thumbPhotoSize = doc.thumb, thumbPhotoSize = doc.thumb,
width, height; width, height;
@ -1901,7 +1901,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
} }
doc.thumb = thumb; doc.thumb = thumb;
doc.withPreview = !Config.Mobile && doc.mime_type.match(/^(image\/)/) ? 1 : 0; doc.withPreview = !Config.Mobile && doc.mime_type.match(/^image\/(gif|png|jpeg|jpg|bmp|tiff)/) ? 1 : 0;
if (isGif && doc.thumb) { if (isGif && doc.thumb) {
doc.isSpecial = 'gif'; doc.isSpecial = 'gif';