Opened 13 years ago
Closed 13 years ago
#25803 closed defect (bug) (fixed)
wrong url for get_avatar
| Reported by: | lite3 | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.8 |
| Component: | Comments | Version: | |
| Severity: | major | Keywords: | has-patch |
| Cc: | Focuses: |
Description
description
- one user registered at website.
- write a comment.
- remove the user.
- the user's avatar is wrong.
solve it
if not had user for $comment->user_id, use $comment->comment_author_email
Attachments (1)
Change History (7)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Replying to mauryaratan:
not here. in function get_avatar of wp-includes/pluggable.php.
===old code:===
// No avatar for pingbacks or trackbacks $allowed_comment_types = apply_filters( 'get_avatar_comment_types', array( 'comment' ) ); if ( ! empty( $id_or_email->comment_type ) && ! in_array( $id_or_email->comment_type, (array) $allowed_comment_types ) ) return false; if ( !empty($id_or_email->user_id) ) { $id = (int) $id_or_email->user_id; $user = get_userdata($id); if ( $user) $email = $user->user_email; } elseif ( !empty($id_or_email->comment_author_email) ) { $email = $id_or_email->comment_author_email; }===new code:===
// No avatar for pingbacks or trackbacks $allowed_comment_types = apply_filters( 'get_avatar_comment_types', array( 'comment' ) ); if ( ! empty( $id_or_email->comment_type ) && ! in_array( $id_or_email->comment_type, (array) $allowed_comment_types ) ) return false; if ( !empty($id_or_email->user_id) ) { $id = (int) $id_or_email->user_id; $user = get_userdata($id); if ( $user) $email = $user->user_email; } if ( $email === '' && !empty($id_or_email->comment_author_email) ) { $email = $id_or_email->comment_author_email; }