From f9d1a2554d180ac79000fe6263c7f57ea4f3f8ec Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Sat, 2 Apr 2016 16:51:28 +0530 Subject: [PATCH] FIX: do not allow SVG image as digest logo --- app/helpers/user_notifications_helper.rb | 4 ++-- config/locales/server.en.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/user_notifications_helper.rb b/app/helpers/user_notifications_helper.rb index 24ca2ef22..4f4ca687a 100644 --- a/app/helpers/user_notifications_helper.rb +++ b/app/helpers/user_notifications_helper.rb @@ -19,9 +19,9 @@ module UserNotificationsHelper def logo_url logo_url = SiteSetting.digest_logo_url - logo_url = SiteSetting.logo_url if logo_url.blank? + logo_url = SiteSetting.logo_url if logo_url.blank? || logo_url =~ /\.svg$/i - return nil if logo_url.blank? + return nil if logo_url.blank? || logo_url =~ /\.svg$/i if logo_url !~ /http(s)?\:\/\// logo_url = "#{Discourse.base_url}#{logo_url}" end diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 70ff7b770..77a750839 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -837,7 +837,7 @@ en: onebox_domains_whitelist: "A list of domains to allow oneboxing for; these domains should support OpenGraph or oEmbed. Test them at http://iframely.com/debug" logo_url: "The logo image at the top left of your site, should be a wide rectangle shape. If left blank site title text will be shown." - digest_logo_url: "The alternate logo image used at the top of your site's email digest. Should be a wide rectangle shape. If left blank `logo_url` will be used." + digest_logo_url: "The alternate logo image used at the top of your site's email digest. Should be a wide rectangle shape. Should not be an SVG image. If left blank `logo_url` will be used." logo_small_url: "The small logo image at the top left of your site, should be a square shape, seen when scrolling down. If left blank a home glyph will be shown." favicon_url: "A favicon for your site, see http://en.wikipedia.org/wiki/Favicon, to work correctly over a CDN it must be a png" mobile_logo_url: "The fixed position logo image used at the top left of your mobile site. Should be a square shape. If left blank, `logo_url` will be used. eg: http://example.com/uploads/default/logo.png"