php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51072 filter_var with FILTER_VALIDATE_EMAIL accepts incorrect emails
Submitted: 2010-02-17 17:32 UTC Modified: 2010-04-25 19:59 UTC
From: schicker03 at gmail dot com Assigned: felipe (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: 5.2.12 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: schicker03 at gmail dot com
New email:
PHP Version: OS:

 

 [2010-02-17 17:32 UTC] 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".

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-17 17:33 UTC] 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-19 09:34 UTC] schicker03 at gmail dot com
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
 [2010-02-25 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2010-04-25 19:59 UTC] felipe@php.net
-Status: No Feedback +Status: Closed -Assigned To: +Assigned To: felipe
 [2010-04-25 19:59 UTC] felipe@php.net
It was already fixed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 08:01:30 2024 UTC