From 077af6e47d0f7c2ab6c67f1ad623355ca661e245 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Wed, 16 Jan 2019 06:16:49 +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. Built from https://develop.svn.wordpress.org/trunk@44620 git-svn-id: http://core.svn.wordpress.org/trunk@44451 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 10 +++++----- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index e9ab7f37b1..0b96541c37 100644 --- a/wp-includes/formatting.php +++ b/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 ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index a0fd28d1cb..14b09111b4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-beta1-44619'; +$wp_version = '5.1-beta1-44620'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.