Skip Navigation


Resolved in: WP Rocket lastest version

Topic Tags: Compatibility

Overview of the issue

The function rocket_clean_domain takes one parameter: $lang
Its normally called with no parameters, but there is one case when the wrong parameter is sent:

wp-rocket/inc/common/purge.php line 22

add_action( 'update_option_theme_mods_' . get_option( 'stylesheet' ), 'rocket_clean_domain' ); // When location of a menu is updated

This filter sends the incorrect parameter to rocket_clean_domain (an array instead of a string).


In your theme directory, follow this path and open this file (wp-rocket/inc/functions/files.php).
Find the below code:

function rocket_clean_domain( $lang = '' ) {
    $urls = ( ! $lang || is_object( $lang ) ) ? get_rocket_i18n_uri() : get_rocket_i18n_home_url( $lang );

One solution would be to add is_array() to that condition, see the below code:

function rocket_clean_domain( $lang = '' ) {
    $urls = ( ! $lang || is_object( $lang ) || is_array( $lang ) ) ? get_rocket_i18n_uri() : get_rocket_i18n_home_url( $lang );

This way, we won’t send the array as parameter and everything will work as expected.