Skip to:
Content

Opened 2 years ago

Closed 2 years ago

#3063 closed defect (duplicate)

PHP Error with PHP 7.1

Reported by: aheling Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.5.12
Component: Component - Forums Keywords:
Cc:

Description

Hello,
I am getting an PHP Error in the frontend.

Fatal error: Uncaught Error: [] operator not supported for strings in /srv/www/soundaktuell.ah.dev.1drop.de/current/web/app/plugins/bbpress/includes/forums/functions.php on line 1800

My PHP version is 7.1.2.

The problem is that $post_stati in some cases is an empty string and in line 1800 is tried to add an array field to this string variable.

This would fix the issue.

/** Default ***********************************************************/

// Get any existing post status
$post_stati = $posts_query->get( 'post_status' );

// Default to public status
if ( empty( $post_stati ) ) {
	$post_stati = null;
	$post_stati[] = bbp_get_public_status_id();

	// Split the status string
} elseif ( is_string( $post_stati ) ) {
	$post_stati = explode( ',', $post_stati );
}

Attachments (1)

3063.patch (536 bytes) - added by SergeyBiryukov 2 years ago.

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
2 years ago

  • Component changed from General to Component - Forums

Related: #3053

@SergeyBiryukov
2 years ago

#2 @SergeyBiryukov
2 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 2.6

#3 @SergeyBiryukov
2 years ago

  • Keywords has-patch removed
  • Milestone 2.6 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Nevermind, it's already fixed in [6135], see #3031.

Note: See TracTickets for help on using tickets.