From bad4bd31db037d017692ec3b573dea60143f0dbd Mon Sep 17 00:00:00 2001
From: Florian Schaal <florian@schaal-24.de>
Date: Sat, 16 Jan 2016 04:39:09 -0500
Subject: [PATCH] some more filter_var for email

---
 interface/web/client/form/client.tform.php         |    9 +++------
 interface/web/mailuser/form/mail_user_cc.tform.php |    6 ++----
 interface/web/client/form/reseller.tform.php       |   16 ++++------------
 3 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/interface/web/client/form/client.tform.php b/interface/web/client/form/client.tform.php
index 88d6872..8de4105 100644
--- a/interface/web/client/form/client.tform.php
+++ b/interface/web/client/form/client.tform.php
@@ -329,9 +329,7 @@
 					'type' => 'TOLOWER')
 			),
 			'validators' => array (  
-				0 => array ( 'type' => 'REGEX',
-					'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}$/i',
-					'errmsg'=> 'email_error_isemail'),
+				0 => array ( 'type' => 'ISEMAIL', 'errmsg'=> 'email_error_isemail'),
 				1 => array ( 'type' => 'NOTEMPTY',
 					'errmsg'=> 'email_error_empty'),
 			),
@@ -502,9 +500,8 @@
 				2 => array( 'event' => 'SAVE',
 					'type' => 'TOLOWER')
 			),
-			'validators' => array (  0 => array ( 'type' => 'REGEX',
-					'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}$/i',
-					'errmsg'=> 'paypal_email_error_isemail'),
+			'validators' => array (
+				0 => array ( 'type' => 'ISEMAIL', 'errmsg'=> 'email_error_isemail'),
 			),
 			'default' => '',
 			'value'  => '',
diff --git a/interface/web/client/form/reseller.tform.php b/interface/web/client/form/reseller.tform.php
index 1a8b303..9bc416f 100644
--- a/interface/web/client/form/reseller.tform.php
+++ b/interface/web/client/form/reseller.tform.php
@@ -328,15 +328,8 @@
 				2 => array( 'event' => 'SAVE','type' => 'TOLOWER')
 			),
 			'validators' => array (
-				0 => array ( 'type' => 'REGEX',
-					'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}$/i',
-					'errmsg'=> 'email_error_isemail'),
-				1 => array ( 'type' => 'NOTEMPTY',
-					'errmsg'=> 'email_error_empty'),
-			),
-			'validators' => array (  0 => array ( 'type' => 'REGEX',
-					'regex' => '/^\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}$/i',
-					'errmsg'=> 'email_error_isemail'),
+				0 => array ( 'type' => 'ISEMAIL', 'errmsg'=> 'email_error_isemail'),
+				1 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'email_error_empty'),
 			),
 			'default' => '',
 			'value'  => '',
@@ -505,9 +498,8 @@
 				2 => array( 'event' => 'SAVE',
 					'type' => 'TOLOWER')
 			),
-			'validators' => array (  0 => array ( 'type' => 'REGEX',
-					'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}$/i',
-					'errmsg'=> 'paypal_email_error_isemail'),
+			'validators' => array (
+				0 => array ( 'type' => 'ISEMAIL', 'errmsg'=> 'paypal_email_error_isemail'),
 			),
 			'default' => '',
 			'value'  => '',
diff --git a/interface/web/mailuser/form/mail_user_cc.tform.php b/interface/web/mailuser/form/mail_user_cc.tform.php
index 5f1d9ef..6c200b9 100644
--- a/interface/web/mailuser/form/mail_user_cc.tform.php
+++ b/interface/web/mailuser/form/mail_user_cc.tform.php
@@ -68,10 +68,8 @@
 				2 => array( 'event' => 'SAVE',
 					'type' => 'TOLOWER')
 			),
-			'validators' => array (  0 => array ( 'type' => 'REGEX',
-					//'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\w+\.[a-z\-]{2,10}){0,1}$/i',
-					'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}(,\s*\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,}$/i',
-					'errmsg'=> 'cc_error_isemail'),
+			'validators' => array (
+				0 => array ( 'type' => 'ISEMAIL', 'errmsg'=> 'cc_error_isemail'),
 			),
 			'default' => '',
 			'value'  => '',

--
Gitblit v1.9.1