Bug in bbPress
-
I am using WordPress 4.8 multisite and noticed a bug in bbPress 2.5.12 and 2.5.13 (possibly older versions as well) with PHP 7.1.6.
Lines 1798-1805 of includes/forum/functions.php is
// Default to public status if (empty( $post_stati ) ) { $post_stati[] = bbp_get_public_status_id(); // Split the status string } elseif ( is_string( $post_stati ) ) { $post_stati = explode( ',', $post_stati ); }
For me $post_stati looks to be an empty string so the if is evaluating to true and the next line is failing with this error:
Fatal error: Uncaught Error: [] operator not supported for strings in /srv/www/tilth.org/current/web/app/plugins/bbpress/includes/forums/functions.php on line 1800
Changing line 1799 to:
if (is_array( $post_stati) && empty( $post_stati ) ) {
looks to fix the error.
Perhaps adding a line inside the conditional of
$post_stati = array();
is a better fix.
- You must be logged in to reply to this topic.