Ticket #38708: 38708.2.diff
File 38708.2.diff, 1.9 KB (added by , 7 years ago) |
---|
-
src/wp-includes/formatting.php
2872 2872 _deprecated_argument( __FUNCTION__, '3.0.0' ); 2873 2873 2874 2874 // Test for the minimum length the email can be 2875 if ( strlen( $email ) < 3) {2875 if ( strlen( $email ) < 6 ) { 2876 2876 /** 2877 2877 * Filters whether an email address is valid. 2878 2878 * -
src/wp-includes/rest-api.php
1077 1077 break; 1078 1078 1079 1079 case 'email' : 1080 // is_email() checks for 3 characters (a@b), but 1081 // wp_handle_comment_submission() requires 6 characters (a@b.co) 1082 // 1083 // https://core.trac.wordpress.org/ticket/38506 1084 if ( ! is_email( $value ) || strlen( $value ) < 6 ) { 1080 if ( ! is_email( $value ) ) { 1085 1081 return new WP_Error( 'rest_invalid_email', __( 'Invalid email address.' ) ); 1086 1082 } 1087 1083 break; -
tests/phpunit/tests/formatting/IsEmail.php
9 9 "bob@example.com", 10 10 "phil@example.info", 11 11 "ace@204.32.222.14", 12 "kevin@many.subdomains.make.a.happy.man.edu" 12 "kevin@many.subdomains.make.a.happy.man.edu", 13 "a@b.co", 13 14 ); 14 15 foreach ( $data as $datum ) { 15 16 $this->assertEquals( $datum, is_email( $datum ), $datum ); … … 22 23 'http://bob.example.com/', 23 24 "sif i'd give u it, spamer!1", 24 25 "com.exampleNOSPAMbob", 25 "bob@your mom" 26 "bob@your mom", 27 "a@b.c", 26 28 ); 27 29 foreach ($data as $datum) { 28 30 $this->assertFalse(is_email($datum), $datum);