Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

secure gravatar image #23

Merged
merged 1 commit into from

2 participants

@rmcfrazier

Pull request for the develop branch. This adds logic to check is page is secure and if so make gravatar call using secure URL.

@rmcfrazier

Were you able to review this patch for the develop branch?

@danielbachhuber danielbachhuber merged commit e233f59 into Automattic:develop
@danielbachhuber

Yep, looks good. Thanks for contributing!

@danielbachhuber danielbachhuber referenced this pull request from a commit
@danielbachhuber danielbachhuber Changelog note for #23 76602f2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 3, 2012
  1. @rmcfrazier
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 2 deletions.
  1. +9 −2 js/co-authors-plus.js
View
11 js/co-authors-plus.js
@@ -283,8 +283,15 @@ jQuery(document).ready(function () {
// Adapted from http://www.deluxeblogtips.com/2010/04/get-gravatar-using-only-javascript.html
function get_gravatar_link(email, size) {
- var size = size || 80;
- return 'http://www.gravatar.com/avatar/' + MD5(email) + '.jpg?s=' + size;
+ var size = size || 80;
+
+ // need to check if page is secure or not
+ var gravatar_url = 'http://www.gravatar.com/avatar/';
+ if ("https:" == document.location.protocol) {
+ // secure
+ gravatar_url = 'https://secure.gravatar.com/avatar/';
+ }
+ return gravatar_url + MD5(email) + '.jpg?s=' + size;
}
/*
Something went wrong with that request. Please try again.