From fdd285c433848e5ddd4f9882cb0602245bb5c9bb Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Wed, 16 Jan 2019 06:15:40 +0000 Subject: [PATCH] Docs: Improve the `sanitize_email` filter. - Remove duplicate parameter names. - Fix the wrong value being passed in the second parameter. - Correct the type of the `$message` parameter. Props ChriCo. Fixes #45595. git-svn-id: https://develop.svn.wordpress.org/trunk@44620 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/formatting.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index ddc2de5488..67a732d51a 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -3456,9 +3456,9 @@ function sanitize_email( $email ) { * * @since 2.8.0 * - * @param string $email The sanitized email address. - * @param string $email The email address, as provided to sanitize_email(). - * @param string $message A message to pass to the user. + * @param string $sanitized_email The sanitized email address. + * @param string $email The email address, as provided to sanitize_email(). + * @param string|null $message A message to pass to the user. null if email is sanitized. */ return apply_filters( 'sanitize_email', '', $email, 'email_too_short' ); } @@ -3531,11 +3531,11 @@ function sanitize_email( $email ) { $domain = join( '.', $new_subs ); // Put the email back together - $email = $local . '@' . $domain; + $sanitized_email = $local . '@' . $domain; // Congratulations your email made it! /** This filter is documented in wp-includes/formatting.php */ - return apply_filters( 'sanitize_email', $email, $email, null ); + return apply_filters( 'sanitize_email', $sanitized_email, $email, null ); } /**