diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index c524b06928..576b3c657a 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -2137,8 +2137,15 @@ function sanitize_user( $username, $strict = false ) { */ function sanitize_key( $key ) { $raw_key = $key; - $key = strtolower( $key ); - $key = preg_replace( '/[^a-z0-9_\-]/', '', $key ); + + if ( ! is_string( $key ) ) { + $key = ''; + } + + if ( '' !== $key ) { + $key = strtolower( $key ); + $key = preg_replace( '/[^a-z0-9_\-]/', '', $key ); + } /** * Filters a sanitized key string. diff --git a/wp-includes/version.php b/wp-includes/version.php index a720a13e36..d890e34c51 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-52291'; +$wp_version = '5.9-alpha-52292'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.