Make WordPress Core

Ticket #25108: 25108.diff

File 25108.diff, 816 bytes (added by DrewAPicture, 12 years ago)
  • wp-includes/formatting.php

     
    18551855                return apply_filters( 'is_email', false, $email, 'domain_no_periods' );
    18561856        }
    18571857
     1858        $i = 0;
    18581859        // Loop through each sub
    18591860        foreach ( $subs as $sub ) {
    18601861                // Test for leading and trailing hyphens and whitespace
     
    18661867                if ( !preg_match('/^[a-z0-9-]+$/i', $sub ) ) {
    18671868                        return apply_filters( 'is_email', false, $email, 'sub_invalid_chars' );
    18681869                }
     1870
     1871                // Test for fewer than 2 characters in last sub
     1872                if ( ++$i === count( $subs ) && strlen( $sub ) < 2 )
     1873                        return apply_filters( 'is_email', false, $email, 'last_sub_too_few_chars' );
    18691874        }
    18701875
    18711876        // Congratulations your email made it!