]> source.dussan.org Git - redmine.git/commitdiff
Turn on ssl Gravatars for all SSL requests. #5929
authorEric Davis <edavis@littlestreamsoftware.com>
Mon, 20 Sep 2010 02:55:14 +0000 (02:55 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Mon, 20 Sep 2010 02:55:14 +0000 (02:55 +0000)
Contributed by Felix Schäfer

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4103 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb

index eecbc5b916b06fdce2cfbb3808af9d65f40cd8d7..6ba40eb451150d6055554e2b61d2b5ca3ec17a9e 100644 (file)
@@ -829,7 +829,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 => Setting.protocol == 'https', :default => Setting.gravatar_default})
+      options.merge!({:ssl => (defined?(request) && request.ssl?), :default => Setting.gravatar_default})
       email = nil
       if user.respond_to?(:mail)
         email = user.mail