Make WordPress Core

Changeset 57990

Timestamp:
04/13/2024 04:31:55 PM (3 months ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/pluggable.php

    r57882 r57990  
    618618        $user = apply_filters( 'authenticate', null, $username, $password );
    619619
    620         if ( null === $user ) {
     620        if ( null === $user ) {
    621621            /*
    622622             * TODO: What should the error message be? (Or would these even happen?)
  • trunk/tests/phpunit/tests/auth.php

    r57987 r57990  
    435435
    436436    /**
     437
     438
     439
     440
     441
     442
     443
     444
     445
     446
    437447     * @ticket 36476
    438448     */
Note: See TracChangeset for help on using the changeset viewer.