From:             andrew dot nicols at luns dot net dot uk
Operating system: Debian
PHP version:      5.2.11
PHP Bug Type:     Filter related
Bug description:  FILTER_VALIDATE_EMAIL incorrectly marks an address as valid 
if it contains =

Description:
------------
The filter_var function, when used with FILTER_VALIDATE_EMAIL marks an
email address with an = in it as invalid.

According to RFCs 822, 2822 and 5322, = is a valid component to the
local-part of an e-mail address.

Reproduce code:
---------------
<?php    
    
$email_address = "test=m...@example.com";    
var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));    
                                                                
$email_address = "test-m...@example.com";    
var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));    
    
$email_address = "test+m...@example.com";    
var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));    
                                                                        
?>


Expected result:
----------------
string(21) "test-m...@example.com"
string(21) "test-m...@example.com"
string(21) "test+m...@example.com"


Actual result:
--------------
bool(false)
string(21) "test+m...@example.com"
string(21) "test+m...@example.com"

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

Reply via email to