Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure BP Activity Akismet History is an array before sorting it #93

Closed
wants to merge 2 commits into from

Conversation

imath
Copy link
Member

@imath imath commented Apr 29, 2023

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


This Pull Request is for code review only. Please keep all other discussion in the BuddyPress Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the WordPress Core Handbook for more details.

@imath imath changed the title Make sure BP Activity Akismet Hitory is an array before sorting it Make sure BP Activity Akismet History is an array before sorting it Apr 29, 2023
@imath imath deleted the patch/8873 branch April 30, 2023 07:42
dcavins pushed a commit to dcavins/buddypress-wp-svn that referenced this pull request Jul 28, 2023
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 buddypress/buddypress#93



git-svn-id: http://buddypress.svn.wordpress.org/trunk@13466 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant