Make WordPress Core

Changeset 12863


Ignore:
Timestamp:
01/27/2010 01:27:25 AM (15 years ago)
Author:
wpmuguru
Message:

deprecate validate_email(), fixes #11745

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-deprecated.php

    r12858 r12863  
    126126}
    127127
     128/**
     129 * @deprecated 3.0
     130 */
     131function validate_email( $email, $check_domain = true) {
     132    return is_email( $email, $check_domain );
     133}
     134
    128135?>
  • trunk/wp-includes/ms-functions.php

    r12858 r12863  
    900900}
    901901
    902 function validate_email( $email, $check_domain = true) {
    903     if (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.
    904         '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
    905         '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email))
    906     {
    907         if ($check_domain && function_exists('checkdnsrr')) {
    908             list (, $domain)  = explode('@', $email);
    909 
    910             if (checkdnsrr($domain.'.', 'MX') || checkdnsrr($domain.'.', 'A'))
    911                 return true;
    912             return false;
    913         }
    914         return true;
    915     }
    916     return false;
    917 }
    918 
    919902function is_email_address_unsafe( $user_email ) {
    920903    $banned_names = get_site_option( "banned_email_domains" );
     
    982965    if ( !is_email( $user_email ) )
    983966        $errors->add('user_email', __("Please enter a correct email address"));
    984 
    985     if ( !validate_email( $user_email ) )
    986         $errors->add('user_email', __("Please check your email address."));
    987967
    988968    $limited_email_domains = get_site_option( 'limited_email_domains' );
Note: See TracChangeset for help on using the changeset viewer.