diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2ef22c4..e825630 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -824,7 +824,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