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.

Built from https://develop.svn.wordpress.org/trunk@32845


git-svn-id: http://core.svn.wordpress.org/trunk@32816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-06-18 18:36:25 +00:00
parent c1a9c4b7b8
commit 09c4444150
4 changed files with 12 additions and 6 deletions

View File

@ -109,8 +109,6 @@ if ( ! $credits ) {
echo '<p class="about-description">' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "</p>\n";
$gravatar = is_ssl() ? 'https://secure.gravatar.com/avatar/' : 'http://0.gravatar.com/avatar/';
foreach ( $credits['groups'] as $group_slug => $group_data ) {
if ( $group_data['name'] ) {
if ( 'Translators' == $group_data['name'] ) {
@ -144,8 +142,11 @@ foreach ( $credits['groups'] as $group_slug => $group_data ) {
foreach ( $group_data['data'] as $person_data ) {
echo '<li class="wp-person" id="wp-person-' . $person_data[2] . '">' . "\n\t";
echo '<a href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">';
$size = 'compact' == $group_data['type'] ? '30' : '60';
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";
$size = 'compact' == $group_data['type'] ? 30 : 60;
$data = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
$size *= 2;
$data2x = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
echo '<img src="' . esc_attr( $data['url'] ) . '" srcset="' . esc_attr( $data2x['url'] ) . ' 2x" class="gravatar" alt="' . esc_attr( $person_data[0] ) . '" /></a>' . "\n\t";
echo '<a class="web" href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">' . $person_data[0] . "</a>\n\t";
if ( ! $compact )
echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";

View File

@ -102,6 +102,7 @@ function get_last_build_date_feed() {
if ( $wp_query->have_posts() ) {
$post_ids = array();
$post_times = array();
foreach( $wp_query->posts as $post ) {
$post_ids[] = $post->ID;
$post_times[] = $post->post_modified_gmt;

View File

@ -3650,7 +3650,11 @@ function get_avatar_data( $id_or_email, $args = null ) {
'r' => $args['rating'],
);
$url = sprintf( 'http://%d.gravatar.com/avatar/%s', $gravatar_server, $email_hash );
if ( is_ssl() ) {
$url = 'https://secure.gravatar.com/avatar/' . $email_hash;
} else {
$url = sprintf( 'http://%d.gravatar.com/avatar/%s', $gravatar_server, $email_hash );
}
$url = add_query_arg(
rawurlencode_deep( array_filter( $url_args ) ),

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-alpha-32844';
$wp_version = '4.3-alpha-32845';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.