php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55478 FILTER_VALIDATE_EMAIL fails with valid addresses containing "--" twice
Submitted: 2011-08-22 17:00 UTC Modified: 2011-12-04 14:52 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: ch@php.net Assigned: iliaa
Status: Closed Package: Filter related
PHP Version: 5.4.0alpha3 OS: any
Private report: No CVE-ID:
 [2011-08-22 17:00 UTC] ch@php.net
Description:
------------
The FILTER_VALIDATE_EMAIL check fails with valid adresses that contain "--" twice because they have e.g. a German Umlaut ("ä") after a dash ("-").

The following examples can be verified using the converter tool on the DeNIC page at http://www.denic.de/domains/internationalized-domain-names/idn-konvertierung.html

 IDN: example-ä.de
 ACE-String: xn--example--7za.de


Test script:
---------------
--TEST--
Bug #XXXXX (FILTER_VALIDATE_EMAIL fails with valid addresses containing "--" twice)
--FILE--
<?php

$email_address = "test@xn--example--7za.de"; // "example-ä.de"
var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));    

?>
--EXPECTF--
%unicode|string%(21) "test@xn--example--7za.de"


Expected result:
----------------
"test@xn--example--7za.de"

Actual result:
--------------
bool(false)

$ TEST_PHP_EXECUTABLE=/home/chammers/workspace/php-src-5.4/sX.phpt /php ./run-tests.php ext/filter/tests/bugXXXXX

=====================================================================
PHP         : /home/chammers/workspace/php-src-5.4/sapi/cli/php 
PHP_SAPI    : cli
PHP_VERSION : 5.4.0beta1-dev
ZEND_VERSION: 2.4.0
PHP_OS      : Linux - Linux sys-251 2.6.38-bpo.2-686 #1 SMP Tue Jun 14 11:43:18 UTC 2011 i686
INI actual  : /home/chammers/workspace/php5/php5-5.3.3
More .INIs  :  
CWD         : /home/chammers/workspace/php5/php5-5.3.3
Extra dirs  : 
VALGRIND    : Not used
=====================================================================
Running selected tests.
FAIL Bug #XXXXX (FILTER_VALIDATE_EMAIL fails with valid addresses containing "--" twice) [ext/filter/tests/bugXXXXX.phpt] 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-04 14:52 UTC] iliaa@php.net
Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=320369
Log: Fixed Bug #55478 (FILTER_VALIDATE_EMAIL fails with internationalized
domain name addresses containing &gt;1 -).
 [2011-12-04 14:52 UTC] iliaa@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: iliaa
 [2011-12-04 14:52 UTC] iliaa@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-04-18 09:47 UTC] laruence@php.net
Automatic comment on behalf of iliaa
Revision: http://git.php.net/?p=php-src.git;a=commit;h=932f8d4cbdd7034f838ace193e560a34e3ff4786
Log: Fixed Bug #55478 (FILTER_VALIDATE_EMAIL fails with internationalized domain name addresses containing &gt;1 -).
 [2012-07-24 23:38 UTC] rasmus@php.net
Automatic comment on behalf of iliaa
Revision: http://git.php.net/?p=php-src.git;a=commit;h=932f8d4cbdd7034f838ace193e560a34e3ff4786
Log: Fixed Bug #55478 (FILTER_VALIDATE_EMAIL fails with internationalized domain name addresses containing &gt;1 -).
 [2013-11-17 09:34 UTC] laruence@php.net
Automatic comment on behalf of iliaa
Revision: http://git.php.net/?p=php-src.git;a=commit;h=932f8d4cbdd7034f838ace193e560a34e3ff4786
Log: Fixed Bug #55478 (FILTER_VALIDATE_EMAIL fails with internationalized domain name addresses containing &gt;1 -).
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 06:02:27 2014 UTC