fix custom emoji support when using subfolder
This commit is contained in:
parent
823e50b099
commit
747f4812e4
|
@ -43,7 +43,7 @@ class Emoji
|
||||||
filename = "#{emoji['filename'] || name}.png"
|
filename = "#{emoji['filename'] || name}.png"
|
||||||
Emoji.new.tap do |e|
|
Emoji.new.tap do |e|
|
||||||
e.name = name
|
e.name = name
|
||||||
e.url = "/images/emoji/#{SiteSetting.emoji_set}/#{filename}"
|
e.url = "#{Discourse.base_uri}/images/emoji/#{SiteSetting.emoji_set}/#{filename}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -102,6 +102,7 @@ class Emoji
|
||||||
Plugin::CustomEmoji.emojis.each do |name, url|
|
Plugin::CustomEmoji.emojis.each do |name, url|
|
||||||
result << Emoji.new.tap do |e|
|
result << Emoji.new.tap do |e|
|
||||||
e.name = name
|
e.name = name
|
||||||
|
url = (Discourse.base_uri + url) if url[/^\/[^\/]/]
|
||||||
e.url = url
|
e.url = url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,7 +15,6 @@ class Plugin::CustomEmoji
|
||||||
|
|
||||||
def self.register(name, url)
|
def self.register(name, url)
|
||||||
@@cache_key = Digest::SHA1.hexdigest(cache_key + name)[0..10]
|
@@cache_key = Digest::SHA1.hexdigest(cache_key + name)[0..10]
|
||||||
url = Discourse.base_uri + url if url[/^\/[^\/]/]
|
|
||||||
emojis[name] = url
|
emojis[name] = url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue