Use SSL for gravatars according to the protocol in settings (#9365).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10184 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-08-09 18:04:54 +00:00
parent e06bf0c464
commit cbfafcd5e2
2 changed files with 31 additions and 19 deletions
+1 -1
View File
@@ -1134,7 +1134,7 @@ module ApplicationHelper
# +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <joe@foo.bar>')
def avatar(user, options = { })
if Setting.gravatar_enabled?
options.merge!({:ssl => (request && request.ssl?), :default => Setting.gravatar_default})
options.merge!({:ssl => (Setting.protocol == 'https'), :default => Setting.gravatar_default})
email = nil
if user.respond_to?(:mail)
email = user.mail