WordPress.org

Make WordPress Core

Changeset 14381


Ignore:
Timestamp:
05/03/2010 06:54:37 PM (8 years ago)
Author:
nacin
Message:

Deprecate checkdnsrr from is_email. Unused in core, and wonky on some server setups (Mac OS X < PHP 5.3 specifically). A plugin can always add it back. props technosailor, fixes #12503.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r14231 r14381  
    14661466 *
    14671467 * @param string $email Email address to verify.
    1468  * @param boolean $check_dns Whether to check the DNS for the domain using checkdnsrr().
     1468 * @param boolean $deprecated. Deprecated.
    14691469 * @return string|bool Either false or the valid email address.
    14701470 */
    1471 function is_email( $email, $check_dns = false ) {
     1471function is_email( $email, $deprecated = false ) {
     1472    if ( ! empty( $deprecated ) )
     1473        _deprecated_argument( __FUNCTION__, '3.0' );
     1474
    14721475    // Test for the minimum length the email can be
    14731476    if ( strlen( $email ) < 3 ) {
     
    15191522            return apply_filters( 'is_email', false, $email, 'sub_invalid_chars' );
    15201523        }
    1521     }
    1522 
    1523     // DNS
    1524     // Check the domain has a valid MX and A resource record
    1525     if ( $check_dns && function_exists( 'checkdnsrr' ) && !( checkdnsrr( $domain . '.', 'MX' ) || checkdnsrr( $domain . '.', 'A' ) ) ) {
    1526         return apply_filters( 'is_email', false, $email, 'dns_no_rr' );
    15271524    }
    15281525
Note: See TracChangeset for help on using the changeset viewer.