mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 17:53:44 +08:00
FIX: ensure the post url is present
Also don't interpolate a string
This commit is contained in:
parent
a188d15b08
commit
0df5349dbf
|
@ -438,9 +438,9 @@ after_initialize do
|
|||
on(:reduce_excerpt) do |doc, options|
|
||||
post = options[:post]
|
||||
|
||||
replacement = post ?
|
||||
replacement = post&.url.present? ?
|
||||
"<a href='#{UrlHelper.escape_uri(post.url)}'>#{I18n.t("poll.poll")}</a>" :
|
||||
"#{I18n.t("poll.poll")}"
|
||||
I18n.t("poll.poll")
|
||||
|
||||
doc.css("div.poll").each do |poll|
|
||||
poll.replace(replacement)
|
||||
|
|
Loading…
Reference in New Issue
Block a user