Users: Account for returning false from the authenticate filter.

While technically only `null`, `WP_User`, or `WP_Error` should be returned from the `authenticate` filter, a plugin might return boolean `false` instead, which would trigger the `authentication_failed` error prior to [57882].

This commit aims to preserve that behavior in case `false` is returned.

Follow-up to [57882].

Props johnbillion.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57990


git-svn-id: http://core.svn.wordpress.org/trunk@57476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2024-04-13 16:33:13 +00:00
parent 8d0570f72c
commit 7bb686d18b
2 changed files with 2 additions and 2 deletions

View File

@ -617,7 +617,7 @@ if ( ! function_exists( 'wp_authenticate' ) ) :
*/
$user = apply_filters( 'authenticate', null, $username, $password );
if ( null === $user ) {
if ( null === $user || false === $user ) {
/*
* TODO: What should the error message be? (Or would these even happen?)
* Only needed if all authentication handlers fail to return anything.

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-alpha-57989';
$wp_version = '6.6-alpha-57990';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.