Fatal error — array_merge(): Argument #1 must be of type array, bool given

Getting a fatal error on the latest version, on both wp-admin and the frontend:

Uncaught TypeError: array_merge(): Argument #1 must be of type array, bool given in
/wp-content/plugins/wp-cerber/cerber-settings.php:816

Stack trace:
cerber-settings.php(816): array_merge()
cerber-ds.php(892): crb_get_settings()
cerber-load.php(133): require_once()
wp-cerber.php(233): require_once()

Looks like the same class of bug as the one fixed in 9.6.1 at line 1037, some settings value is coming back as false instead of an array and getting passed straight into array_merge(), which is fatal on PHP 8+.

Since it fires during plugin bootstrap, it takes down the whole site, not just one admin screen.
Seeing this on more than one install, so it doesn’t look like corrupted site-specific data, feels like a regression from the DB layer changes since 9.7.4.

Environment:
PHP 8.2.31
WordPress (current supported version)
WP Cerber: latest release

Could someone take a look? Happy to provide more detail if useful.

Thanks for reporting this. We’ll look into it.

I’ve confirmed this as a bug in the settings loading path. It can occur when the stored WP Cerber configuration value in the database is corrupted or has been altered and can no longer be loaded as a valid settings array.

The most common cause is a database search-replace, migration, restore, or optimization tool that modifies serialized strings without preserving their internal length markers. For example, if the actual string length changes but the serialized s:N:"..." prefix still contains the old length, the whole serialized block can no longer be parsed correctly.

In that condition, the plugin may pass false into array_merge() , which causes a fatal error on PHP 8+ during plugin bootstrap. So yes, the impact can be serious, but it is not expected to affect all installations.

A fix will be available in the upcoming version of WP Cerber. For now, follow one of the attached instructions below.

How to restore the website if WP Cerber fails to load because of corrupted settings.md (2.8 KB)

Emergency recovery the website if WP Cerber fails to load because of corrupted settings.md (3.4 KB)