#51072 [Com]: filter_var with FILTER_VALIDATE_EMAIL accepts incorrect emails

From: Date: Fri, 19 Feb 2010 09:34:29 +0000
Subject: #51072 [Com]: filter_var with FILTER_VALIDATE_EMAIL accepts incorrect emails
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-147857@lists.php.net to get a copy of this message
 ID:               51072
 Comment by:       schicker03 at gmail dot com
 Reported By:      schicker03 at gmail dot com
 Status:           Feedback
 Bug Type:         Unknown/Other Function
 Operating System: Linux
 PHP Version:      5.2.12
 New Comment:

Ahh Ok,

we do have an etch debian with PHP 5.2.0 on our testsystem.
I checked the live system with lenny2 and PHP 5.2.6.

The result with 5.2.6 is as I expected it.
Boolean false is returned.

Thanks
schicker03


Previous Comments:
------------------------------------------------------------------------

[2010-02-17 17:33:49] derick@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

------------------------------------------------------------------------

[2010-02-17 17:32:38] schicker03 at gmail dot com

Description:
------------
An incorrect email is returned as correct from filter_var with the
FILTER_VALIDATE_EMAIL option.

The php version is 
"PHP Version 5.2.0-8+etch10"

that has not been in the dropdown above so i added it here.





Reproduce code:
---------------
---
From manual page: function.filter-var
---

<?php
/*
 * note the missing t in the domain part
 * false : @-online.de
 * correct: @t-online.de
 */
$email = "doesnotmatter@-online.de"
$abc = filter_var($email, FILTER_VALIDATE_EMAIL);
					
var_dump($abc);
?>


Expected result:
----------------
The variable $abc should be the boolean value false.


Actual result:
--------------
The variable $abc contains the email from $email
"doesnotmatter@-online.de".


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=51072&edit=1



Thread (4 messages)

« previous php.bugs (#147857) next »