From: Eric Davis Date: Mon, 20 Sep 2010 02:55:14 +0000 (+0000) Subject: Turn on ssl Gravatars for all SSL requests. #5929 X-Git-Tag: 1.1.0~355 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=09331ec432bc0b3b308ecd4f44e39dcccf670eb7;p=redmine.git Turn on ssl Gravatars for all SSL requests. #5929 Contributed by Felix Schäfer git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4103 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index eecbc5b91..6ba40eb45 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -829,7 +829,7 @@ module ApplicationHelper # +user+ can be a User or a string that will be scanned for an email address (eg. 'joe ') 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