Make WordPress Core


Ignore:
Timestamp:
10/28/2024 08:03:13 PM (6 weeks ago)
Author:
SergeyBiryukov
Message:

Users: Set correct default value for $user_login in retrieve_password().

This resolves a "passing null to non-nullable" deprecation notice on PHP 8.1+:

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated

Follow-up to [50129], [54477].

Props afragen, peterwilsoncc, SergeyBiryukov.
Fixes #62298.

File:
1 edited

Legend:

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

    r59232 r59312  
    31073107 * @return true|WP_Error True when finished, WP_Error object on error.
    31083108 */
    3109 function retrieve_password( $user_login = null ) {
     3109function retrieve_password( $user_login = '' ) {
    31103110    $errors    = new WP_Error();
    31113111    $user_data = false;
Note: See TracChangeset for help on using the changeset viewer.