Opened 5 weeks ago
Last modified 8 days ago
#3636 new defect (bug)
Fatal error: array_merge(): Argument #1 must be of type array, string given in includes/forums/functions.php:2342
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | major | Version: | 2.6.13 |
Component: | Component - Forums | Keywords: | has-patch needs-testing |
Cc: |
Description
BBpress: 2.6.13
WP: 6.8.1
Php: 8.1.28
I found this in my log files:
PHP Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, string given in /wp-content/plugins/bbpress/includes/forums/functions.php:2342
Seems like the following doesn't always return an array, so a type check might be in order;
Get any existing not-in queries
$not_in = $posts_query->get( 'postnot_in', array() );
Add our not-in to existing
$not_in = array_unique( array_merge( $not_in, $forum_ids ) );
Change History (2)
This ticket was mentioned in PR #32 on bbpress/bbPress by @rollybueno.
8 days ago
#1
- Keywords has-patch added
Ensures is always an array before array_merge to prevent fatal error
Issue: https://bbpress.trac.wordpress.org/ticket/3636