Skip to:
Content

BuddyPress.org

#8873 closed defect (bug) (fixed)

Fatal error when the Activity Akismet history is empty (Single Activity WP Admin screen)

Reported by: mystichrome's profile mystichrome Owned by: imath's profile imath
Milestone: 11.2.0 Priority: normal
Severity: normal Version: 1.6
Component: Activity Keywords: has-patch
Cc:

Description

PS: Aaron contacted me directly to alert me about this issue
@imath

There's a fatal error triggered by BP_Akismet::get_activity_history() about using usort() with a string. I guess this case happens because we are not checking the '_bp_akismet_history' activity meta exists and contains an array.

See https://buddypress.trac.wordpress.org/browser/trunk/src/bp-activity/classes/class-bp-akismet.php#L714

Change History (3)

This ticket was mentioned in PR #93 on buddypress/buddypress by @imath.


13 months ago
#1

  • Keywords has-patch added

Into BP_Akismet->get_activity_history() method, make sure the Activity meta used to store the Akismet history is an array before sorting with an Akismet comparison function.

Trac ticket: https://buddypress.trac.wordpress.org/ticket/8873

#2 @imath
13 months ago

In 13466:

Improve how the BP_Akismet() class displays an activity history

When the Akismet plugin is active and is used to prevent BP Activity spams, each Activity item gets an Akismet history. This history is only generated for activities being posted once Akismet is on. As a result, there can be old activities with no history. To avoid potential PHP errors/notices, we need to verify the Activity Meta used to store the history is an array and has a time key.

As we are dealing with the latest history entry only, we do not need to sort the Activity Meta.

To display the activity history into its single WP Admin screen, we now need to use the time & message keys of the Activity Meta.

Props mystichrome

See #8873 (trunk)
Closes https://github.com/buddypress/buddypress/pull/93

#3 @imath
13 months ago

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

In 13467:

Improve how the BP_Akismet() class displays an activity history

When the Akismet plugin is active and is used to prevent BP Activity spams, each Activity item gets an Akismet history. This history is only generated for activities being posted once Akismet is on. As a result, there can be old activities with no history. To avoid potential PHP errors/notices, we need to verify the Activity Meta used to store the history is an array and has a time key.

As we are dealing with the latest history entry only, we do not need to sort the Activity Meta.

To display the activity history into its single WP Admin screen, we now need to use the time & message keys of the Activity Meta.

Props mystichrome

Fixes #8873 (11.0 branch)

Note: See TracTickets for help on using tickets.