Bug #55478 [Com]: FILTER_VALIDATE_EMAIL fails with valid addresses containing "--" twice
| From: | qing0088 at hotmail dot com | Date: | Mon, 29 Aug 2011 08:21:29 +0000 |
| Subject: | Bug #55478 [Com]: FILTER_VALIDATE_EMAIL fails with valid addresses containing "--" twice | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-163054@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55478&edit=1
ID: 55478
Comment by: qing0088 at hotmail dot com
Reported by: ch@php.net
Summary: FILTER_VALIDATE_EMAIL fails with valid addresses
containing "--" twice
Status: Open
Type: Bug
Package: Filter related
Operating System: any
PHP Version: 5.4.0alpha3
Block user comment: N
Private report: N
New Comment:
http://www.officialpackersjerseyshop.com/green-bay-packers-jerseys-bj-raji-jersey-c-11_23.html B.J.
Raji Jersey
http://www.officialpackersjerseyshop.com/green-bay-packers-jerseys-bart-starr-jersey-c-11_26.html Bart
Starr Jersey
http://www.officialpackersjerseyshop.com/green-bay-packers-jerseys-brett-favre-jersey-c-11_12.html Brett
Favre Jersey
Previous Comments:
------------------------------------------------------------------------
[2011-08-22 17:00:16] 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]
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55478&edit=1