From 4e0958051e00d2f624b8c1b98924ab651c8dd229 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Mon, 28 Nov 2016 14:35:59 -0500 Subject: [PATCH] FIX: don't try to show svg's in summary email --- app/helpers/user_notifications_helper.rb | 4 ++++ app/views/user_notifications/digest.html.erb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers/user_notifications_helper.rb b/app/helpers/user_notifications_helper.rb index ad82c3c4f5e..10231369f1e 100644 --- a/app/helpers/user_notifications_helper.rb +++ b/app/helpers/user_notifications_helper.rb @@ -93,6 +93,10 @@ module UserNotificationsHelper PrettyText.format_for_email(I18n.t(i18n_key)).html_safe end + def show_image_with_url(url) + !(url.nil? || url.downcase.end_with?('svg')) + end + def email_image_url(basename) UrlHelper.absolute("#{Discourse.base_uri}/images/emails/#{basename}") end diff --git a/app/views/user_notifications/digest.html.erb b/app/views/user_notifications/digest.html.erb index 72dc79a86a2..d8819a9da7a 100644 --- a/app/views/user_notifications/digest.html.erb +++ b/app/views/user_notifications/digest.html.erb @@ -134,7 +134,7 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo

<%= t.user.name -%>

<% end %> - <%- if t.image_url.present? -%> + <%- if show_image_with_url(t.image_url) -%>