From 09c44441500538ba4edb40b0b9fb0e5b3dd9271d Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 18 Jun 2015 18:36:25 +0000 Subject: [PATCH] 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 --- wp-admin/credits.php | 9 +++++---- wp-includes/feed.php | 1 + wp-includes/link-template.php | 6 +++++- wp-includes/version.php | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/wp-admin/credits.php b/wp-admin/credits.php index 299bbf073b..9cc4544c29 100644 --- a/wp-admin/credits.php +++ b/wp-admin/credits.php @@ -109,8 +109,6 @@ if ( ! $credits ) { echo '

' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "

\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 '
  • ' . "\n\t"; echo ''; - $size = 'compact' == $group_data['type'] ? '30' : '60'; - echo '' . esc_attr( $person_data[0] ) . '' . "\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 '' . esc_attr( $person_data[0] ) . '' . "\n\t"; echo '' . $person_data[0] . "\n\t"; if ( ! $compact ) echo '' . translate( $person_data[3] ) . "\n"; diff --git a/wp-includes/feed.php b/wp-includes/feed.php index bd795d0da7..01e2c2427a 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -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; diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index a09dfdb57c..00d3d98a24 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -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 ) ), diff --git a/wp-includes/version.php b/wp-includes/version.php index 3c648afc0f..2ee01ec3af 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.