Opened 9 years ago
Closed 9 years ago
#2591 closed defect (bug) (fixed)
User Badges plugin should check for WP_Error in ::get_author_badge_info()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Component: | Support Forums | Keywords: | has-patch commit |
| Cc: |
Description
wp_get_post_terms() can return an empty array if no terms were found, or a WP_Error object if the taxonomy does not exist.
User_Badges\Plugin::get_author_badge_info() has a check for the former, but not for the latter. Normally, this code only runs when the taxonomy exists, but it can still lead to a fatal error if WPORG_SUPPORT_FORUMS_BLOGID is not defined (e.g. to differentiate between English and Rosetta forums on a local install):
Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in wp-content/plugins/wporg-bbp-user-badges/inc/class-plugin.php:142
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
In 5156: