From 747f4812e4323fa303bc2bfc84fcc61f715d7e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Fri, 24 Mar 2017 02:09:39 +0100 Subject: [PATCH] fix custom emoji support when using subfolder --- app/models/emoji.rb | 3 ++- lib/plugin/instance.rb | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/emoji.rb b/app/models/emoji.rb index 4fee27f5f64..e098719b0a0 100644 --- a/app/models/emoji.rb +++ b/app/models/emoji.rb @@ -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 diff --git a/lib/plugin/instance.rb b/lib/plugin/instance.rb index 5ef7278c6b1..e6b8c047565 100644 --- a/lib/plugin/instance.rb +++ b/lib/plugin/instance.rb @@ -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