fix custom emoji support when using subfolder

This commit is contained in:
Régis Hanol 2017-03-24 02:09:39 +01:00
parent 823e50b099
commit 747f4812e4
2 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ class Emoji
filename = "#{emoji['filename'] || name}.png"
Emoji.new.tap do |e|
e.name = name
e.url = "/images/emoji/#{SiteSetting.emoji_set}/#{filename}"
e.url = "#{Discourse.base_uri}/images/emoji/#{SiteSetting.emoji_set}/#{filename}"
end
end
@ -102,6 +102,7 @@ class Emoji
Plugin::CustomEmoji.emojis.each do |name, url|
result << Emoji.new.tap do |e|
e.name = name
url = (Discourse.base_uri + url) if url[/^\/[^\/]/]
e.url = url
end
end

View File

@ -15,7 +15,6 @@ class Plugin::CustomEmoji
def self.register(name, url)
@@cache_key = Digest::SHA1.hexdigest(cache_key + name)[0..10]
url = Discourse.base_uri + url if url[/^\/[^\/]/]
emojis[name] = url
end
end