Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82049 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65600 invoked from network); 6 Feb 2015 15:15:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Feb 2015 15:15:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-we0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:35099] helo=mail-we0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/16-45146-F7AD4D45 for ; Fri, 06 Feb 2015 10:15:12 -0500 Received: by mail-we0-f170.google.com with SMTP id q59so5441901wes.1 for ; Fri, 06 Feb 2015 07:15:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=INSZhT91Xzf7SEQJKjMJ6F1N/vxU2H5gaJjwjYYMDoA=; b=Aqyh0fPLcF8NDSPO+G35K7Aaf01zitVQwoIcMiNBoNG9Y/WEEG7oGIWmodMxN73Eiu tJ1TqncraETreFZqTOi0RYULglYaV26I+mheD9ohZbCYXH6hWD46CtR85LOSJZrPZzna ijxpGocQr3tm1h4UUWbhuX7Qy1J0sYr4OlFA9krBZQo3uthY8rdxCyPrqhNVPZEatJ7q D5WnrQ6FhPGii8Mg5rNbsH3/cVY0AShMj+K4a021V4q9oWZyFsZ42MLpQbZCxkLt3BOz GP0lSA+ZLyiklOppnkIHt+JMUkcjwJkAOp+XleLdtD3CNk/skDwf4IXlp5rmvvNYZv0m 1uzg== X-Received: by 10.194.184.212 with SMTP id ew20mr8793098wjc.88.1423235709030; Fri, 06 Feb 2015 07:15:09 -0800 (PST) Received: from [192.168.0.172] ([62.189.198.114]) by mx.google.com with ESMTPSA id er13sm3767997wjc.11.2015.02.06.07.15.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Feb 2015 07:15:07 -0800 (PST) Message-ID: <54D4DA6E.1060606@gmail.com> Date: Fri, 06 Feb 2015 15:14:54 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: internals@lists.php.net, zardozrocks@gmail.com References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] filter_var doesn't support international email addresses From: rowan.collins@gmail.com (Rowan Collins) j adams wrote on 06/02/2015 00:05: > Please let me know which mailing list address to use if I have sent this to > the wrong list. > > filter_var does not properly validate emails with international characters. > For example, this returns FALSE: > > var_dump(filter_var("Pelé@example.com", FILTER_VALIDATE_EMAIL)); > > Are there any plans to implement proper validation of email addresses as > described in RFC 6530? > http://tools.ietf.org/html/rfc6530 Hi, There was a discussion a while back about Internationalized Domain Name support in FILTER_VALIDATE_URL [1], and I believe there was a concern that since not all systems would accept the wider format, allowing them through the existing filter might be unhelpful. This is particularly true in the case of internationalized e-mails, since if I understand it correctly it's an "all or nothing" system, rather than one with a compatible fallback like the "punycode" notation used in domains. The most useful would probably be to add a new filter type which accepted the new format, so that users could choose to accept what they know they can process. If you know of or can create a succinct validity test (e.g. a PCRE-compatible regex) it ought to be fairly easy to add; the existing implementation is here for comparison: http://lxr.php.net/xref/PHP_TRUNK/ext/filter/logical_filters.c#575 [1] http://grokbase.com/t/php/php-internals/149jfzxtq3/internationalized-domain-name-support-in-filter-validate-url Regards, -- Rowan Collins [IMSoP]