Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix for PHP Deprecated: trim():
Fix for PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in \wp-includes\pluggable.php on line 598
  • Loading branch information
lenasterg authored Oct 19, 2022
commit 88800b959f1e0831fece41a7a9102d5107ef776f
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