From 9d8f1101e80c3392f3030f0a3edd1a16b17a8c0c Mon Sep 17 00:00:00 2001 From: Marc Florisson Date: Fri, 7 Sep 2012 16:54:00 +0200 Subject: fix user_default_avatar --- app/helpers/users_helper.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/helpers/users_helper.rb') diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 82ecb3273..6ebb20fc5 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -7,8 +7,10 @@ module UsersHelper def user_default_avatar return "#{root_url}#{image_path('icons/user.png')}" if Rails.application.config.relative_url_root.blank? - relative_url_root = Rails.application.config.relative_url_root.sub( /\//, '') - "#{root_url}#{image_path('icons/user.png')}".sub( Regexp.new("/#{relative_url_root}/#{relative_url_root}/"), "/#{relative_url_root}/") + relative_url_root = Rails.application.config.relative_url_root.gsub( /\//, '') + "#{root_url}#{image_path('icons/user.png')}". + sub( Regexp.new("/#{relative_url_root}/#{relative_url_root}/"), "/#{relative_url_root}/"). + sub( Regexp.new("/#{relative_url_root}//#{relative_url_root}/"), "/#{relative_url_root}/") end end -- cgit v1.2.3