From 623d9920915bcadff344d0646ede7daffbc5c182 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sat, 25 Dec 2010 14:57:35 +0000 Subject: [PATCH] functions.inc.php: - check_domain(): don't trim() the domain - whitespace is an error. This catches "foo@ domain.com" that wasn't catched before. git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@902 a1433add-5e2c-0410-b055-b7f2511e0802 --- functions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.inc.php b/functions.inc.php index 879ebd48..ed5074d8 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -229,7 +229,7 @@ function check_domain ($domain) global $CONF; global $PALANG; - if (!preg_match ('/([-0-9A-Z]+\.)+' . '([0-9A-Z]){2,6}$/i', trim ($domain))) + if (!preg_match ('/^([-0-9A-Z]+\.)+' . '([0-9A-Z]){2,6}$/i', ($domain))) { flash_error(sprintf($PALANG['pInvalidDomainRegex'], htmlentities($domain))); return false;