diff --git a/src/wp-admin/includes/user.php b/src/wp-admin/includes/user.php
index bb68ad9c62..5dbdafd629 100644
--- a/src/wp-admin/includes/user.php
+++ b/src/wp-admin/includes/user.php
@@ -143,7 +143,7 @@ function edit_user( $user_id = 0 ) {
$errors->add( 'user_login', __( 'ERROR: This username is already registered. Please choose another one.' ));
/** This filter is documented in wp-includes/user-functions.php */
- $illegal_logins = apply_filters( 'illegal_user_logins', array() );
+ $illegal_logins = (array) apply_filters( 'illegal_user_logins', array() );
if ( in_array( strtolower( $user->user_login ), array_map( 'strtolower', $illegal_logins ) ) ) {
$errors->add( 'illegal_user_login', __( 'ERROR: Sorry, that username is not allowed.' ) );
diff --git a/src/wp-includes/ms-functions.php b/src/wp-includes/ms-functions.php
index d54a838e10..ac1d5c6d80 100644
--- a/src/wp-includes/ms-functions.php
+++ b/src/wp-includes/ms-functions.php
@@ -432,7 +432,7 @@ function wpmu_validate_user_signup($user_name, $user_email) {
}
/** This filter is documented in wp-includes/user-functions.php */
- $illegal_logins = apply_filters( 'illegal_user_logins', array() );
+ $illegal_logins = (array) apply_filters( 'illegal_user_logins', array() );
if ( in_array( strtolower( $user_name ), array_map( 'strtolower', $illegal_logins ) ) ) {
$errors->add( 'user_name', __( 'Sorry, that username is not allowed.' ) );
diff --git a/src/wp-includes/user-functions.php b/src/wp-includes/user-functions.php
index 1a71fcaaad..2b8151fd3d 100644
--- a/src/wp-includes/user-functions.php
+++ b/src/wp-includes/user-functions.php
@@ -1328,7 +1328,7 @@ function wp_insert_user( $userdata ) {
*
* @param array $usernames Array of blacklisted usernames.
*/
- $illegal_logins = apply_filters( 'illegal_user_logins', array() );
+ $illegal_logins = (array) apply_filters( 'illegal_user_logins', array() );
if ( in_array( strtolower( $user_login ), array_map( 'strtolower', $illegal_logins ) ) ) {
return new WP_Error( 'illegal_user_login', __( 'Sorry, that username is not allowed.' ) );