Skip to:
Content

BuddyPress.org

Opened 7 years ago

Closed 7 years ago

#7637 closed defect (bug) (fixed)

Improper use of `count()` in blog post activity media extractor

Reported by: boonebgorges's profile boonebgorges Owned by: djpaul's profile djpaul
Milestone: 3.0 Priority: normal
Severity: normal Version:
Component: Activity Keywords: has-patch
Cc:

Description

See https://buddypress.trac.wordpress.org/browser/trunk/src/bp-activity/bp-activity-functions.php?marks=3259#L3241. The members of 'has' are already counts; they don't need to be run through count() again. Doing so in PHP 7.2 throws errors (see https://travis-ci.org/buddypress/BuddyPress/jobs/310294527), while doing so before 7.2 introduces a silent bug where the para_count is always decremented by 1 or 0.

@djpaul Ping for a quick review of the attached patch.

Attachments (1)

7637.diff (592 bytes) - added by boonebgorges 7 years ago.

Download all attachments as: .zip

Change History (4)

@boonebgorges
7 years ago

#1 @boonebgorges
7 years ago

  • Component changed from Core to Activity
  • Owner set to djpaul
  • Status changed from new to reviewing

#2 @DJPaul
7 years ago

Yes, good find.

#3 @djpaul
7 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 11756:

Activity: fix paragraph counting error when creating activity summaries.

Fixes #7637

Props boonebgorges

Note: See TracTickets for help on using tickets.