Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use secure.gravatar.com for SSL avatar requests. fixes #8988 for 2.7

git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
commit a5b6247297740569a6fa59e7bf81c82c22f6ebc7 1 parent 5be8ce4
ryan authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 wp-includes/pluggable.php
View
13 wp-includes/pluggable.php
@@ -1529,21 +1529,26 @@ function get_avatar( $id_or_email, $size = '96', $default = '', $alt = false ) {
$default = $avatar_default;
}
+ if ( is_ssl() )
+ $host = 'https://secure.gravatar.com';
+ else
+ $host = 'http://www.gravatar.com';
+
if ( 'mystery' == $default )
- $default = "http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com')
+ $default = "$host/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com')
elseif ( 'blank' == $default )
$default = includes_url('images/blank.gif');
elseif ( !empty($email) && 'gravatar_default' == $default )
$default = '';
elseif ( 'gravatar_default' == $default )
- $default = "http://www.gravatar.com/avatar/s={$size}";
+ $default = "$host/avatar/s={$size}";
elseif ( empty($email) )
- $default = "http://www.gravatar.com/avatar/?d=$default&s={$size}";
+ $default = "$host/avatar/?d=$default&s={$size}";
elseif ( strpos($default, 'http://') === 0 )
$default = add_query_arg( 's', $size, $default );
if ( !empty($email) ) {
- $out = 'http://www.gravatar.com/avatar/';
+ $out = "$host/avatar/";
$out .= md5( strtolower( $email ) );
$out .= '?s='.$size;
$out .= '&d=' . urlencode( $default );
Please sign in to comment.
Something went wrong with that request. Please try again.