diff --git a/projects/packages/waf/src/class-compatibility.php b/projects/packages/waf/src/class-compatibility.php index 0e3b93f769cd6..567e0d0381843 100644 --- a/projects/packages/waf/src/class-compatibility.php +++ b/projects/packages/waf/src/class-compatibility.php @@ -346,13 +346,16 @@ public static function update_option_waf_ip_lists_enabled( $old_value, $value ) * @param mixed $value The new value of the option. */ public static function update_option_waf_ip_allow_list_enabled( $old_value, $value ) { - $block_list_enabled = Jetpack_Options::get_raw_option( Waf_Rules_Manager::IP_BLOCK_LIST_ENABLED_OPTION_NAME, false ); + $block_list_enabled = Jetpack_Options::get_raw_option( Waf_Rules_Manager::IP_BLOCK_LIST_ENABLED_OPTION_NAME, false ); + // @phan-suppress-next-line PhanDeprecatedClassConstant -- Needed for backwards compatibility. $legacy_option_enabled = Jetpack_Options::get_raw_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME, false ); if ( $value && ! $legacy_option_enabled ) { + // @phan-suppress-next-line PhanDeprecatedClassConstant -- Needed for backwards compatibility. update_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME, true ); } if ( ! $value && ! $block_list_enabled ) { + // @phan-suppress-next-line PhanDeprecatedClassConstant -- Needed for backwards compatibility. update_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME, false ); } } @@ -366,12 +369,15 @@ public static function update_option_waf_ip_allow_list_enabled( $old_value, $val * @param mixed $value The new value of the option. */ public static function update_option_waf_ip_block_list_enabled( $old_value, $value ) { - $allow_list_enabled = Jetpack_Options::get_raw_option( Waf_Rules_Manager::IP_ALLOW_LIST_ENABLED_OPTION_NAME, false ); + $allow_list_enabled = Jetpack_Options::get_raw_option( Waf_Rules_Manager::IP_ALLOW_LIST_ENABLED_OPTION_NAME, false ); + // @phan-suppress-next-line PhanDeprecatedClassConstant -- Needed for backwards compatibility. $legacy_option_enabled = Jetpack_Options::get_raw_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME, false ); if ( $value && ! $legacy_option_enabled ) { + // @phan-suppress-next-line PhanDeprecatedClassConstant -- Needed for backwards compatibility. update_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME, true ); } if ( ! $value && ! $allow_list_enabled ) { + // @phan-suppress-next-line PhanDeprecatedClassConstant -- Needed for backwards compatibility. update_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME, false ); } }