Bug #69140 [Opn]: FILTER_VALIDATE_EMAIL not RFC 822 compliant

From: Date: Fri, 27 Feb 2015 20:46:26 +0000
Subject: Bug #69140 [Opn]: FILTER_VALIDATE_EMAIL not RFC 822 compliant
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190997@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69140&edit=1 ID: 69140 Updated by: aharvey@php.net Reported by: info at linux-web-development dot de Summary: FILTER_VALIDATE_EMAIL not RFC 822 compliant Status: Open Type: Bug Package: Filter related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: The code does actually document that comments aren't handled, but that never made it to the docs. I'll fix that. I don't think this is worth fixing (the validation code is terrifying enough as it is, and, seriously, comments in e-mail addresses?), but I'll leave this open in case someone can provide a clean PR. Previous Comments: ------------------------------------------------------------------------ [2015-02-27 17:02:32] info at linux-web-development dot de Description: ------------ When trying to validate an e-mail address using FILTER_VALIDATE_EMAIL will result in several problems with correct mail addresses. So far I could find the following compliant addresses not validating: foo@example foo@(bar)example.com foo@example.com(bar) Generally PHP should at comply with RFC 822 when validating mail addresses, otherwise the filter function is useless. Test script: --------------- var_dump(filter_var('foo@example', FILTER_VALIDATE_EMAIL)); Expected result: ---------------- string(11) "foo@example" Actual result: -------------- bool(false) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69140&edit=1

« previous php.bugs (#190997) next »