From d217dd78b3d456a3ddbdbdb4cdc362f0a64a21c5 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 20 Sep 2005 14:40:11 +0000 Subject: [PATCH] changed regex for mailLocalAddress --- lam/lib/account.inc | 3 +++ lam/lib/modules/inetLocalMailRecipient.inc | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lam/lib/account.inc b/lam/lib/account.inc index b4f4562d..3995c7fc 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -474,6 +474,9 @@ function get_preg($argument, $regexp) { case "email": $pregexpr = '/^([0-9a-z\\._-])+[@]([0-9a-z-])+([.]([0-9a-z-])+)*$/'; break; + case "mailLocalAddress": + $pregexpr = '/^([0-9a-z\\._-])+([@]([0-9a-z-])+([.]([0-9a-z-])+)*)?$/'; + break; case "street": // Allow all letters, numbers, space and .-_ $pregexpr = '/^([[:alnum:]\\.\\ \\_-])*$/u'; break; diff --git a/lam/lib/modules/inetLocalMailRecipient.inc b/lam/lib/modules/inetLocalMailRecipient.inc index 5fff22fc..54dbbae4 100644 --- a/lam/lib/modules/inetLocalMailRecipient.inc +++ b/lam/lib/modules/inetLocalMailRecipient.inc @@ -253,7 +253,7 @@ class inetLocalMailRecipient extends baseModule { if (isset($post['delAdr' . $i])) continue; if (isset($post['localAdr' . $i]) && ($post['localAdr' . $i] != "")) { // check if address has correct format - if (!get_preg($post['localAdr' . $i], 'email')) { + if (!get_preg($post['localAdr' . $i], 'mailLocalAddress')) { $message = $this->messages['localAdr'][0]; $message[] = $post['localAdr' . $i]; $this->triggered_messages[] = array($message); @@ -265,7 +265,7 @@ class inetLocalMailRecipient extends baseModule { // check new local address if (isset($post['localAdr']) && ($post['localAdr'] != "")) { // check if address has correct format - if (get_preg($post['localAdr'], 'email')) { + if (get_preg($post['localAdr'], 'mailLocalAddress')) { $this->attributes['mailLocalAddress'][] = $post['localAdr']; } else { @@ -309,7 +309,7 @@ class inetLocalMailRecipient extends baseModule { $adrs = explode(',', $rawAccounts[$i][$ids['inetLocalMailRecipient_localAdr']]); // check format for ($a = 0; $a < sizeof($adrs); $a++) { - if (get_preg($adrs[$a], 'email')) { + if (get_preg($adrs[$a], 'mailLocalAddress')) { $partialAccounts[$i]['mailLocalAddress'][] = $adrs[$a]; } else {