From: pdontthink Date: Thu, 21 May 2009 09:21:56 +0000 (+0000) Subject: Anchor the regexp. Thanks Thijs Kinkhorst. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=870ffc40786e9a810e9a8cd228ec5117e70cdaed;p=squirrelmail.git Anchor the regexp. Thanks Thijs Kinkhorst. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13730 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/class/deliver/Deliver_SMTP.class.php b/class/deliver/Deliver_SMTP.class.php index 279b82cc..2d0aa966 100644 --- a/class/deliver/Deliver_SMTP.class.php +++ b/class/deliver/Deliver_SMTP.class.php @@ -137,7 +137,7 @@ class Deliver_SMTP extends Deliver { // if the host is an IPv4 address, enclose it in brackets // - if (preg_match('/\d+\.\d+\.\d+\.\d+/', $helohost)) + if (preg_match('/^\d+\.\d+\.\d+\.\d+$/', $helohost)) $helohost = '[' . $helohost . ']'; /* Lets introduce ourselves */ diff --git a/src/configtest.php b/src/configtest.php index 261ed2f8..030acf2d 100644 --- a/src/configtest.php +++ b/src/configtest.php @@ -625,7 +625,7 @@ if($useSendmail) { // format EHLO argument correctly if needed // - if (preg_match('/\d+\.\d+\.\d+\.\d+/', $client_ip)) + if (preg_match('/^\d+\.\d+\.\d+\.\d+$/', $client_ip)) $helohost = '[' . $client_ip . ']'; else // some day might add IPv6 here $helohost = $client_ip;