| @@ -330,9 +330,10 @@ | ||
| 330 | 330 | } |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | // @since 2.6.3 |
| 334 | - return (array) apply_filters( 'wd_display_ip_validations', $errors ); | |
| 334 | + $errors = apply_filters( 'wd_display_ip_validations', $errors ); | |
| 335 | + return is_array( $errors ) ? $errors : (array) $errors; | |
| 335 | 336 | } |
| 336 | 337 | |
| 337 | 338 | /** |
| 338 | 339 | * Validate IP. |
| @@ -525,9 +526,10 @@ | ||
| 525 | 526 | * @since 5.3.0 |
| 526 | 527 | * |
| 527 | 528 | * @param array $trusted_ips An array of trusted server IP addresses. |
| 528 | 529 | */ |
| 529 | - $trusted_ips = (array) apply_filters( 'wp_defender_server_ips', array_unique( $trusted_ips ) ); | |
| 530 | + $trusted_ips = apply_filters( 'wp_defender_server_ips', array_unique( $trusted_ips ) ); | |
| 531 | + $trusted_ips = ! is_array( $trusted_ips ) ? (array) $trusted_ips : $trusted_ips; | |
| 530 | 532 | // Only return true if the request IP is in the trusted list. |
| 531 | 533 | if ( array() !== array_intersect( $user_ips, $trusted_ips ) ) { |
| 532 | 534 | return true; |
| 533 | 535 | } |