Skip to content

Commit

Permalink
Fix for PHP Deprecated: trim():
Browse files Browse the repository at this point in the history
Fix for PHP Deprecated:  trim(): Passing null to parameter WordPress#1 ($string) of type string is deprecated in \wp-includes\pluggable.php on line 598
  • Loading branch information
lenasterg authored Oct 19, 2022
1 parent 04e8bb4 commit 88800b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wp-includes/pluggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,9 @@ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array()
*/
function wp_authenticate( $username, $password ) {
$username = sanitize_user( $username );
$password = trim( $password );
if ( is_string( $password ) && '' !== $password ) {
$password = trim( $password );
}

/**
* Filters whether a set of user login credentials are valid.
Expand Down

0 comments on commit 88800b9

Please sign in to comment.