From:             fillmorejd at gmail dot com
Operating system: Mac Mountain Lion
PHP version:      5.4.15
Package:          Filter related
Bug Type:         Bug
Bug description:Email with multiple period in a row fail

Description:
------------
Email with multiple period in a row fail validation when they are working
email.  
With gmail you can add periods into any email address and it will still
deliver.  
I use this to filter out messages.  exam...@gmail.com is the same as 
exam........@gmail.com  or exam....@gmail.com or exam.p....@gmail.com.

With one period or if there is a letter or number between period the 
FILTER_VALIDATE_EMAIL works just fine but if more than one period it fails.


Test script:
---------------
<?php
$email_a = 'exm...@gmail.com';
$email_b = 'exm.a.p...@gmail.com';
$email_c = 'exa......m...@gmail.com';

if (filter_var($email_a, FILTER_VALIDATE_EMAIL)) {
    echo "This ($email_a) email address is considered valid.\n";
} else {
    echo "$email_a failed\n";
}

if (filter_var($email_b, FILTER_VALIDATE_EMAIL)) {
    echo "This ($email_b) email address is considered valid.\n";
} else {
    echo "$email_b failed\n";
}

if (filter_var($email_c, FILTER_VALIDATE_EMAIL)) {
    echo "This ($email_c) email address is considered valid.\n";
} else {
    echo "$email_c failed\n";
}

Expected result:
----------------
This (exm...@gmail.com) email address is considered valid.
This (exm.a.p...@gmail.com) email address is considered valid.
This (exa......m...@gmail.com) email address is considered valid.

Actual result:
--------------
This (exm...@gmail.com) email address is considered valid.
This (exm.a.p...@gmail.com) email address is considered valid.
exa......m...@gmail.com failed

-- 
Edit bug report at https://bugs.php.net/bug.php?id=64981&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64981&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64981&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64981&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64981&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64981&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64981&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64981&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64981&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64981&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64981&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64981&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64981&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64981&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64981&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64981&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64981&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64981&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64981&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64981&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64981&r=mysqlcfg

Reply via email to