From 7bb686d18b16dff0e94c75d87fd3adaecf6a4d7b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 13 Apr 2024 16:33:13 +0000 Subject: [PATCH] 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 --- wp-includes/pluggable.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 51701e787e..5ed63e539c 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -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. diff --git a/wp-includes/version.php b/wp-includes/version.php index 24aa8e9659..e6fcc51c8e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.