- $comment1['comment_author_email'] == $comment2['comment_author_email']
- || stripslashes( $comment1['comment_author_email'] ) == $comment2['comment_author_email']
- || $comment1['comment_author_email'] == stripslashes( $comment2['comment_author_email'] )
+ // The email max length is 100 characters, limited by the VARCHAR(100) column type.
+ substr( $comment1['comment_author_email'], 0, 100 ) == substr( $comment2['comment_author_email'], 0, 100 )
+ || substr( stripslashes( $comment1['comment_author_email'] ), 0, 100 ) == substr( $comment2['comment_author_email'], 0, 100 )
+ || substr( $comment1['comment_author_email'], 0, 100 ) == substr( stripslashes( $comment2['comment_author_email'] ), 0, 100 )
+ // Very long emails can be truncated and then stripped if the [0:100] substring isn't a valid address.
+ || ( ! $comment1['comment_author_email'] && strlen( $comment2['comment_author_email'] ) > 100 )
+ || ( ! $comment2['comment_author_email'] && strlen( $comment1['comment_author_email'] ) > 100 )