Make WordPress Core


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.

File:
1 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 )
Note: See TracChangeset for help on using the changeset viewer.