Automattic / Co-Authors-Plus

Multiple bylines and Guest Authors for WordPress
https://wordpress.org/plugins/co-authors-plus/
GNU General Public License v2.0
287 stars 205 forks source link

get_to_be_filtered_caps not checking for $obj #1047

Open irondan opened 1 month ago

irondan commented 1 month ago

Moved to version 3.6.1 (from version 3.5.x) this month and the number of warnings I started seeing on my site reported by sentry.io skyrocketed (somewhere like 130k more than average in the last 24 hours). They all have been stemming from the get_to_be_filtered_caps function in class_coauthors_plus.php. Specifically, once it enters the loop it's not checking that $obj or $obj->cap is not null before accessing properties on it.

Warning: Attempt to read property "cap" on null

Right now I'm just documenting the issue with this ticket; I've not investigated the root cause so feel free to update this ticket as needed.