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.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
49e39c3b59
commit
b63ee5748a
|
@ -1465,10 +1465,13 @@ function convert_smilies($text) {
|
|||
* @since 0.71
|
||||
*
|
||||
* @param string $email Email address to verify.
|
||||
* @param boolean $check_dns Whether to check the DNS for the domain using checkdnsrr().
|
||||
* @param boolean $deprecated. Deprecated.
|
||||
* @return string|bool Either false or the valid email address.
|
||||
*/
|
||||
function is_email( $email, $check_dns = false ) {
|
||||
function is_email( $email, $deprecated = false ) {
|
||||
if ( ! empty( $deprecated ) )
|
||||
_deprecated_argument( __FUNCTION__, '3.0' );
|
||||
|
||||
// Test for the minimum length the email can be
|
||||
if ( strlen( $email ) < 3 ) {
|
||||
return apply_filters( 'is_email', false, $email, 'email_too_short' );
|
||||
|
@ -1520,12 +1523,6 @@ function is_email( $email, $check_dns = false ) {
|
|||
}
|
||||
}
|
||||
|
||||
// DNS
|
||||
// Check the domain has a valid MX and A resource record
|
||||
if ( $check_dns && function_exists( 'checkdnsrr' ) && !( checkdnsrr( $domain . '.', 'MX' ) || checkdnsrr( $domain . '.', 'A' ) ) ) {
|
||||
return apply_filters( 'is_email', false, $email, 'dns_no_rr' );
|
||||
}
|
||||
|
||||
// Congratulations your email made it!
|
||||
return apply_filters( 'is_email', $email, $email, null );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue