From 0df5349dbf36e533ef30a763c94da84593340eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Thu, 30 May 2019 00:05:53 +0200 Subject: [PATCH] FIX: ensure the post url is present Also don't interpolate a string --- plugins/poll/plugin.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/poll/plugin.rb b/plugins/poll/plugin.rb index c1fdd157f1e..b9c554240a2 100644 --- a/plugins/poll/plugin.rb +++ b/plugins/poll/plugin.rb @@ -438,9 +438,9 @@ after_initialize do on(:reduce_excerpt) do |doc, options| post = options[:post] - replacement = post ? + replacement = post&.url.present? ? "#{I18n.t("poll.poll")}" : - "#{I18n.t("poll.poll")}" + I18n.t("poll.poll") doc.css("div.poll").each do |poll| poll.replace(replacement)