Nov 06, 2023 10:59 am
Hi,
After upgrading our server to PHP 8, we are getting a lot of Warnings in the logs. These aren't causing bugs for users, but our logs are being flooded!
The main culprit is this one:
PHP Warning: Undefined array key "guest_can_comment" in /site/wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Form.php on line 1731
but there's also this one:
PHP Warning: Undefined array key "show_subscription_bar" in /site/wp-content/plugins/wpdiscuz/forms/wpdFormAttr/Form.php on line 218
Both of these weren't an issue in PHP 7, but PHP 8 is a little stricter about these things.
The simplest solution is to wrap these checks in
!empty()
so that, for example, line 218 would become:
$isSubscriptionBarEnabled = ! empty( $this->generalOptions["show_subscription_bar"] );
3 Replies
Nov 06, 2023 11:55 am
We'll check and get back to you soon.