Commit c2ba868c9b92a90e53972b5e357c39df2606699c

Authored by Dmitriy Zaporozhets
2 parents f22488f7 157b0386

Merge pull request #2954 from cabeca/fix-image-url-emoji

Fix image url for emoji.
Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
app/helpers/application_helper.rb
@@ -164,7 +164,8 @@ module ApplicationHelper @@ -164,7 +164,8 @@ module ApplicationHelper
164 end 164 end
165 165
166 def image_url(source) 166 def image_url(source)
167 - root_url + path_to_image(source) 167 + # prevent relative_root_path being added twice (it's part of root_url and path_to_image)
  168 + root_url.sub(/#{root_path}$/, path_to_image(source))
168 end 169 end
169 170
170 alias_method :url_to_image, :image_url 171 alias_method :url_to_image, :image_url