Skip to:
Content

BuddyPress.org

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#7568 closed defect (bug) (fixed)

Avoid passing WP_Comment object to `is_email()` when filtering avatar URL

Reported by: needle Owned by: r-a-y
Milestone: 2.9 Priority: normal
Severity: minor Version:
Component: Core Keywords: has-patch
Cc:

Description

Comments by anonymous comment authors (i.e. without a user account) fall through the current logic in bp_core_get_avatar_data_url_filter and the WP_Comment object is passed to is_email() which expects a string - and therefore throws a PHP Warning: "strlen() expects parameter 1 to be string".

Attachments (2)

7568.patch (762 bytes) - added by needle 2 years ago.
7568.01.patch (742 bytes) - added by r-a-y 2 years ago.

Download all attachments as: .zip

Change History (7)

@needle
2 years ago

#1 @r-a-y
2 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 2.9

Ugh. Good catch.

I hate that we have to do our own user checking in the 'get_avatar_url' filter. WordPress shouldn't make us have to do that.

@r-a-y
2 years ago

#2 @r-a-y
2 years ago

  • Keywords has-patch added; needs-patch removed

Oops, didn't see your patch there, @needle! Same as mine :)

Will commit in the next hour.

#3 @needle
2 years ago

@r-a-y No problem and thanks!

#4 @r-a-y
2 years ago

  • Owner set to r-a-y
  • Resolution set to fixed
  • Status changed from new to closed

In 11638:

Avatars: After r11627, fix notices appearing for anonymous commenters.

Props needle. See #7424.

Fixes #7568.

This ticket was mentioned in Slack in #buddypress by r-a-y. View the logs.


2 years ago

Note: See TracTickets for help on using tickets.