Make WordPress Core

Changeset 32845


Ignore:
Timestamp:
06/18/2015 06:35:04 PM (9 years ago)
Author:
wonderboymusic
Message:

Make sure that all Gravatars are generated by get_avatar() or at least run through apply_filters( 'get_avatar', $avatar ) for the sake of extensibility.

Props miqrogroove, GlennM, SergeyBiryukov.
Fixes #22650.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/credits.php

    r32654 r32845  
    110110echo '<p class="about-description">' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "</p>\n";
    111111
    112 $gravatar = is_ssl() ? 'https://secure.gravatar.com/avatar/' : 'http://0.gravatar.com/avatar/';
    113 
    114112foreach ( $credits['groups'] as $group_slug => $group_data ) {
    115113    if ( $group_data['name'] ) {
     
    145143                echo '<li class="wp-person" id="wp-person-' . $person_data[2] . '">' . "\n\t";
    146144                echo '<a href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">';
    147                 $size = 'compact' == $group_data['type'] ? '30' : '60';
    148                 echo '<img src="' . $gravatar . $person_data[1] . '?s=' . $size . '" srcset="' . $gravatar . $person_data[1] . '?s=' . $size * 2 . ' 2x" class="gravatar" alt="' . esc_attr( $person_data[0] ) . '" /></a>' . "\n\t";
     145                $size = 'compact' == $group_data['type'] ? 30 : 60;
     146                $data = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
     147                $size *= 2;
     148                $data2x = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
     149                echo '<img src="' . esc_attr( $data['url'] ) . '" srcset="' . esc_attr( $data2x['url'] ) . ' 2x" class="gravatar" alt="' . esc_attr( $person_data[0] ) . '" /></a>' . "\n\t";
    149150                echo '<a class="web" href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">' . $person_data[0] . "</a>\n\t";
    150151                if ( ! $compact )
  • trunk/src/wp-includes/feed.php

    r32800 r32845  
    103103    if ( $wp_query->have_posts() ) {
    104104        $post_ids = array();
     105        $post_times = array();
    105106        foreach( $wp_query->posts as $post ) {
    106107            $post_ids[] = $post->ID;
  • trunk/src/wp-includes/link-template.php

    r32606 r32845  
    36513651    );
    36523652
    3653     $url = sprintf( 'http://%d.gravatar.com/avatar/%s', $gravatar_server, $email_hash );
     3653    if ( is_ssl() ) {
     3654        $url = 'https://secure.gravatar.com/avatar/' . $email_hash;
     3655    } else {
     3656        $url = sprintf( 'http://%d.gravatar.com/avatar/%s', $gravatar_server, $email_hash );
     3657    }
    36543658
    36553659    $url = add_query_arg(
Note: See TracChangeset for help on using the changeset viewer.