[interchange] Disallow comma character within email addresses in email and email_only profile checks (GH #97).

Stefan Hornburg interchange-cvs at icdevgroup.org
Tue Jun 7 09:51:21 UTC 2016


commit 4ff70c20fdb0215fe28ad01825f2381da78f07ed
Author: Marco Pessotto <melmothx at gmail.com>
Date:   Tue Jun 7 11:49:34 2016 +0200

    Disallow comma character within email addresses in email and email_only profile checks (GH #97).

 code/OrderCheck/email_only.oc |    2 +-
 lib/Vend/Order.pm             |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/code/OrderCheck/email_only.oc b/code/OrderCheck/email_only.oc
index 3a06b78..6f76341 100644
--- a/code/OrderCheck/email_only.oc
+++ b/code/OrderCheck/email_only.oc
@@ -12,7 +12,7 @@ CodeDef email_only Description Email address
 CodeDef email_only Routine <<EOR
 sub {
 	my($ref, $var, $val, $msg) = @_;
-	if($val and $val =~ /^[\040-\077\101-\176]+\@[-A-Za-z0-9.]+\.[A-Za-z]+$/) {
+	if($val and $val =~ /^[\040-\053\055-\077\101-\176]+\@[-A-Za-z0-9.]+\.[A-Za-z]+$/) {
 		return (1, $var, '');
 	}
 	else {
diff --git a/lib/Vend/Order.pm b/lib/Vend/Order.pm
index 14c7b31..239de7d 100644
--- a/lib/Vend/Order.pm
+++ b/lib/Vend/Order.pm
@@ -1344,7 +1344,8 @@ sub _phone_us_with_area_strict {
 
 sub _email {
 	my($ref, $var, $val) = @_;
-	if($val and $val =~ /[\040-\077\101-\176]+\@[-A-Za-z0-9.]+\.[A-Za-z]+/) {
+	if($val and $val =~ /[\040-\053\055-\077\101-\176]+\@[-A-Za-z0-9.]+\.[A-Za-z]+/) {
+
 		return (1, $var, '');
 	}
 	else {



More information about the interchange-cvs mailing list