Make WordPress Core

Changeset 13385


Ignore:
Timestamp:
02/24/2010 08:50:40 PM (16 years ago)
Author:
ryan
Message:

Hash to static gravatar domains. Props apokalyptik.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable.php

    r13382 r13385  
    16081608        }
    16091609
    1610         if ( is_ssl() )
     1610        if ( !empty($email) )
     1611                $email_hash = md5( strtolower( $email ) );
     1612
     1613        if ( is_ssl() ) {
    16111614                $host = 'https://secure.gravatar.com';
    1612         else
    1613                 $host = 'http://www.gravatar.com';
     1615        } else {
     1616                if ( !empty($email) )
     1617                        $host = sprintf( "http://w%d.gravatar.com", ( hexdec( $email_hash{0} ) % 2 ) );
     1618                else
     1619                        $host = 'http://www.gravatar.com';
     1620        }
    16141621
    16151622        if ( 'mystery' == $default )
     
    16281635        if ( !empty($email) ) {
    16291636                $out = "$host/avatar/";
    1630                 $out .= md5( strtolower( $email ) );
     1637                $out .= $email_hash;
    16311638                $out .= '?s='.$size;
    16321639                $out .= '&d=' . urlencode( $default );
Note: See TracChangeset for help on using the changeset viewer.