PluginProbe
Vigilant – 100% Free Security Suite: Firewall, 2FA, Login, Headers, Scanner… / 3.0.2
Vigilant – 100% Free Security Suite: Firewall, 2FA, Login, Headers, Scanner… v3.0.2
3.0.5 3.0.4 3.0.3 3.0.2 3.0.1 3.0.0 2.11.12 2.11.11 2.11.10 2.11.9 2.11.7 2.11.8 2.11.6 2.11.5 2.11.4 2.11.3 2.11.1 2.11.2 2.11.0 2.10.5 2.10.4 2.10.3 2.10.2 2.10.1 2.10.0 All 93 releases
← All changes | includes/class-rest-api-security.php +9 -2 2.11.11 → 3.0.2 View file →
@@ -167,9 +167,14 @@
167 167 if ( empty( $current_route ) ) {
168 168 return false;
169 169 }
170 170
171 - $allowed_public = $this->options['allowed_public_endpoints'] ?? array();
171 + // Vigilante_Settings::list_or_shipped(): an empty list of a setting with
172 + // no field on screen is a leftover, not a choice. See its docblock.
173 + $allowed_public = Vigilante_Settings::list_or_shipped(
174 + $this->options['allowed_public_endpoints'] ?? array(),
175 + array( 'rest_api_security', 'allowed_public_endpoints' )
176 + );
172 177
173 178 foreach ( $allowed_public as $endpoint ) {
174 179 if ( strpos( $current_route, $endpoint ) === 0 ) {
175 180 return true;
@@ -342,9 +347,11 @@
342 347 'mode' => $this->options['mode'] ?? 'selective',
343 348 'user_enum_blocked' => ! empty( $this->options['block_user_enumeration'] ),
344 349 'jsonp_disabled' => ! empty( $this->options['disable_jsonp'] ),
345 350 'protected_endpoints' => count( $this->options['protected_endpoints'] ?? array() ),
346 - 'allowed_endpoints' => count( $this->options['allowed_public_endpoints'] ?? array() ),
351 + // Counted from the same value the check uses, or the screen would
352 + // report zero while five endpoints are exempt.
353 + 'allowed_endpoints' => count( Vigilante_Settings::list_or_shipped( $this->options['allowed_public_endpoints'] ?? array(), array( 'rest_api_security', 'allowed_public_endpoints' ) ) ),
347 354 );
348 355 }
349 356
350 357 /**