From b0b57be325e93b0fd10b271ea9fe4be452805e21 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Wed, 27 Jan 2010 01:27:25 +0000 Subject: [PATCH] deprecate validate_email(), fixes #11745 git-svn-id: https://develop.svn.wordpress.org/trunk@12863 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/ms-deprecated.php | 9 ++++++++- wp-includes/ms-functions.php | 20 -------------------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/wp-includes/ms-deprecated.php b/wp-includes/ms-deprecated.php index c571c65be1..5a343c0656 100644 --- a/wp-includes/ms-deprecated.php +++ b/wp-includes/ms-deprecated.php @@ -125,4 +125,11 @@ function is_main_blog() { return is_main_site(); } -?> \ No newline at end of file +/** + * @deprecated 3.0 + */ +function validate_email( $email, $check_domain = true) { + return is_email( $email, $check_domain ); +} + +?> diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index c6aca69f2d..8693588eac 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -899,23 +899,6 @@ function is_blog_user( $blog_id = 0 ) { return false; } -function validate_email( $email, $check_domain = true) { - if (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'. - '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'. - '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email)) - { - if ($check_domain && function_exists('checkdnsrr')) { - list (, $domain) = explode('@', $email); - - if (checkdnsrr($domain.'.', 'MX') || checkdnsrr($domain.'.', 'A')) - return true; - return false; - } - return true; - } - return false; -} - function is_email_address_unsafe( $user_email ) { $banned_names = get_site_option( "banned_email_domains" ); if ($banned_names && !is_array( $banned_names )) @@ -982,9 +965,6 @@ function wpmu_validate_user_signup($user_name, $user_email) { if ( !is_email( $user_email ) ) $errors->add('user_email', __("Please enter a correct email address")); - if ( !validate_email( $user_email ) ) - $errors->add('user_email', __("Please check your email address.")); - $limited_email_domains = get_site_option( 'limited_email_domains' ); if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) { $emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) );