From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= <vsza@vsza.hu>
Date: Wed, 27 Jan 2010 05:02:27 +0100
Subject: [PATCH] Fixing the e-mail validation regexp (foo.@bar.com)
---
cake/libs/validation.php | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cake/libs/validation.php b/cake/libs/validation.php
index 20324dd..4a887a8 100644
--- a/cake/libs/validation.php
+++ b/cake/libs/validation.php
@@ -387,7 +387,7 @@ class Validation extends Object {
}
if (is_null($regex)) {
- $regex = '/^[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@' . self::$__pattern['hostname'] . '$/i';
+ $regex = '/^[\.a-z0-9!#$%&\'*+\/=?^_`{|}~-]+@' . self::$__pattern['hostname'] . '$/i';
}
$return = self::_check($check, $regex);
if ($deep === false || $deep === null) {
--
1.6.5
Hi,
the e-mail address validator in CakePHP considers addresses in the form of
foo.@bar.com invalid because of the regular expression used for this purpose
in cake/libs/validation.php. Although RFC 5322 specifies that the local-part
of an e-mail address cannot end with a dot, some providers (e.g. freemail.hu,
with 3 million mailboxes) allow users to get and use such e-mail addresses.
From a technical viewpoint I agree that such addresses shouldn't be allowed to
be used, but saying "go away, leave our beloved RFC alone" to every user who
visits a CakePHP-based webshop or other website is not a solution either.
I attached a patch, which fixes this particular problem, consider applying it.
--
Veres-Szentkirályi András
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment