Skip to:
Content

BuddyPress.org

Opened 6 years ago

Closed 6 years ago

#7902 closed defect (bug) (fixed)

Potential PHP fatal errors in bp_comment_author_avatar and bp_post_author_avatar

Reported by: xknown's profile xknown Owned by: boonebgorges's profile boonebgorges
Milestone: 4.0 Priority: normal
Severity: normal Version:
Component: Core Keywords:
Cc:

Description

A static analysis tool to detect PHP 7.2 incompatibilities detected that bp_comment_author_avatar and bp_post_author_avatar call the get_avatar function without any arguments (it requires at least 1 argument #). This produces a fatal error in PHP versions >= 7.1 (#)

The code path to reach the get_avatar call is potentially non reachable, but I think it would be good to fix it or maybe remove it if you think this is no longer necessary.

Change History (2)

#1 @boonebgorges
6 years ago

  • Milestone changed from Awaiting Review to 4.0

Thanks for the ticket! This code is indeed unreachable, so we can remove it.

#2 @boonebgorges
6 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 12177:

Remove unreachable code in deprecated avatar functions.

The checks for the existence of bp_core_fetch_avatar() have not
been needed since [1636], when the function was introduced.

Props xknown.
Fixes #7902.

Note: See TracTickets for help on using tickets.