Skip to:
Content

bbPress.org

Opened 14 months ago

Closed 14 months ago

Last modified 14 months ago

#3644 closed defect (bug) (fixed)

Private/Hidden enforcer functions may trigger PHP warnings

Reported by: johnjamesjacoby Owned by: johnjamesjacoby
Priority: normal Milestone: 2.7
Component: Component - Forums Version: 2.0
Severity: normal Keywords: commit
Cc:

Description

Seeing this in some logs:

E_WARNING: Attempt to read property "ID" on null in `wp-content/plugins/bbpress/includes/forums/functions.php:2481

After a bit of research, it's because of an intentionally loose is_singular() check in both bbp_forum_enforce_private() and bbp_forum_enforce_hidden() when weird query variables are requested that just happen to match a bbPress post type.

Change History (2)

#1 @johnjamesjacoby
14 months ago

  • Resolutionfixed
  • Status assignedclosed

In 7341:

Forums: prevent PHP warnings on singular bbPress pages when post ID's are not set.

This change adds checks for empty $wp_query->post->ID before using it inside of bbp_forum_enforce_private() and bbp_forum_enforce_hidden().

In trunk, for 2.7.

Fixes #3644.

#2 @johnjamesjacoby
14 months ago

In 7342:

Forums: prevent PHP warnings on singular bbPress pages when post ID's are not set.

This change adds checks for empty $wp_query->post->ID before using it inside of bbp_forum_enforce_private() and bbp_forum_enforce_hidden().

In branches/2.6, for 2.6.15.

Fixes #3644.

Note: See TracTickets for help on using tickets.