summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-03-15 21:52:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-03-15 21:52:20 +0000
commit3de694f5e58b0fa218735f726a5b7eac02ee5683 (patch)
treece4d14a6c35e846e68d7b0ace47cc74fd56391fc /lib
parentcda9c63d9c211f6dd0be501f2647e92a91f001aa (diff)
downloadredmine-3de694f5e58b0fa218735f726a5b7eac02ee5683.tar.gz
redmine-3de694f5e58b0fa218735f726a5b7eac02ee5683.zip
Use protocol-relative URL for gravatars (#21855).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@15245 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/plugins/gravatar/lib/gravatar.rb14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/plugins/gravatar/lib/gravatar.rb b/lib/plugins/gravatar/lib/gravatar.rb
index a0b1241b2..93c45b25c 100644
--- a/lib/plugins/gravatar/lib/gravatar.rb
+++ b/lib/plugins/gravatar/lib/gravatar.rb
@@ -55,15 +55,9 @@ module GravatarHelper
image_tag src, options
end
- # Returns the base Gravatar URL for the given email hash. If ssl evaluates to true,
- # a secure URL will be used instead. This is required when the gravatar is to be
- # displayed on a HTTPS site.
- def gravatar_api_url(hash, ssl=false)
- if ssl
- "https://secure.gravatar.com/avatar/#{hash}"
- else
- "http://www.gravatar.com/avatar/#{hash}"
- end
+ # Returns the base Gravatar URL for the given email hash
+ def gravatar_api_url(hash)
+ "//www.gravatar.com/avatar/#{hash}"
end
# Return the gravatar URL for the given email address.
@@ -71,7 +65,7 @@ module GravatarHelper
email_hash = Digest::MD5.hexdigest(email)
options = DEFAULT_OPTIONS.merge(options)
options[:default] = CGI::escape(options[:default]) unless options[:default].nil?
- gravatar_api_url(email_hash, options.delete(:ssl)).tap do |url|
+ gravatar_api_url(email_hash).tap do |url|
opts = []
[:rating, :size, :default].each do |opt|
unless options[opt].nil?