Ticket #27270: email_validation.patch
File email_validation.patch, 963 bytes (added by , 10 years ago) |
---|
-
wp-includes/formatting.php
1989 1989 return apply_filters( 'is_email', false, $email, 'local_invalid_chars' ); 1990 1990 } 1991 1991 1992 // DOMAIN PART1993 1992 // Test for sequences of periods 1994 if ( preg_match( '/\.{2,}/', $ domain) ) {1993 if ( preg_match( '/\.{2,}/', $email ) ) { 1995 1994 /** This filter is documented in wp-includes/formatting.php */ 1996 1995 return apply_filters( 'is_email', false, $email, 'domain_period_sequence' ); 1997 1996 } 1998 1997 1999 1998 // Test for leading and trailing periods and whitespace 2000 if ( trim( $domain, " \t\n\r\0\x0B." ) !== $domain ) {1999 if ( trim( $domain, " \t\n\r\0\x0B." ) !== $domain || trim( $local, " \t\n\r\0\x0B." ) !== $local ) { 2001 2000 /** This filter is documented in wp-includes/formatting.php */ 2002 2001 return apply_filters( 'is_email', false, $email, 'domain_period_limits' ); 2003 2002 }