From 0d4283176e9a5ce26bd4ec9dd3e672f034a37e65 Mon Sep 17 00:00:00 2001 From: Michael Bradshaw Date: Tue, 12 Nov 2013 11:37:54 -0700 Subject: [PATCH] Add support for SVG images --- core/client/assets/lib/uploader.js | 2 +- core/server/controllers/admin.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/client/assets/lib/uploader.js b/core/client/assets/lib/uploader.js index 1d2c2e5472..d62e8da0e9 100644 --- a/core/client/assets/lib/uploader.js +++ b/core/client/assets/lib/uploader.js @@ -99,7 +99,7 @@ if (data.jqXHR.status === 413) { $dropzone.find('div.js-fail').text("The image you uploaded was too big."); } else if (data.jqXHR.status === 415) { - $dropzone.find('div.js-fail').text("The image type you uploaded is not supported. Please use .PNG, .JPG, .GIF."); + $dropzone.find('div.js-fail').text("The image type you uploaded is not supported. Please use .PNG, .JPG, .GIF, .SVG."); } else { $dropzone.find('div.js-fail').text("Something went wrong :("); } diff --git a/core/server/controllers/admin.js b/core/server/controllers/admin.js index 587f90090a..54f869a0e1 100644 --- a/core/server/controllers/admin.js +++ b/core/server/controllers/admin.js @@ -48,8 +48,8 @@ adminControllers = { ext = path.extname(req.files.uploadimage.name).toLowerCase(), store = storage.get_storage(); - if ((type !== 'image/jpeg' && type !== 'image/png' && type !== 'image/gif') - || (ext !== '.jpg' && ext !== '.jpeg' && ext !== '.png' && ext !== '.gif')) { + if ((type !== 'image/jpeg' && type !== 'image/png' && type !== 'image/gif' && type !== 'image/svg+xml') + || (ext !== '.jpg' && ext !== '.jpeg' && ext !== '.png' && ext !== '.gif' && ext !== '.svg' && ext !== '.svgz')) { return res.send(415, 'Unsupported Media Type'); }