← All changes
|
jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php
+11
-3
13.7.2
→
16.3-beta
View file →
| @@ -78,9 +78,9 @@ | ||
| 78 | 78 | |
| 79 | 79 | return rest_ensure_response( |
| 80 | 80 | array( |
| 81 | 81 | 'success' => true, |
| 82 | - 'message' => __( 'Rules updated succesfully', 'jetpack-waf' ), | |
| 82 | + 'message' => __( 'Rules updated successfully', 'jetpack-waf' ), | |
| 83 | 83 | ) |
| 84 | 84 | ); |
| 85 | 85 | } |
| 86 | 86 | |
| @@ -89,9 +89,17 @@ | ||
| 89 | 89 | * |
| 90 | 90 | * @return WP_REST_Response |
| 91 | 91 | */ |
| 92 | 92 | public static function waf() { |
| 93 | - return rest_ensure_response( Waf_Runner::get_config() ); | |
| 93 | + return rest_ensure_response( | |
| 94 | + array_merge( | |
| 95 | + Waf_Runner::get_config(), | |
| 96 | + array( | |
| 97 | + 'waf_supported' => Waf_Runner::is_supported_environment(), | |
| 98 | + 'automatic_rules_last_updated' => Waf_Stats::get_automatic_rules_last_updated(), | |
| 99 | + ) | |
| 100 | + ) | |
| 101 | + ); | |
| 94 | 102 | } |
| 95 | 103 | |
| 96 | 104 | /** |
| 97 | 105 | * Update WAF Endpoint |
| @@ -108,9 +116,9 @@ | ||
| 108 | 116 | |
| 109 | 117 | /** |
| 110 | 118 | * IP Lists Enabled |
| 111 | 119 | * |
| 112 | - * @deprecated $next-version$ This is a legacy option maintained here for backwards compatibility. | |
| 120 | + * @deprecated 0.17.0 This is a legacy option maintained here for backwards compatibility. | |
| 113 | 121 | */ |
| 114 | 122 | if ( isset( $request['jetpack_waf_ip_list'] ) ) { |
| 115 | 123 | update_option( Waf_Rules_Manager::IP_BLOCK_LIST_ENABLED_OPTION_NAME, $request['jetpack_waf_ip_list'] ? '1' : '' ); |
| 116 | 124 | update_option( Waf_Rules_Manager::IP_ALLOW_LIST_ENABLED_OPTION_NAME, $request['jetpack_waf_ip_list'] ? '1' : '' ); |