Anchor the regexp. Thanks Thijs Kinkhorst.
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 21 May 2009 09:21:56 +0000 (09:21 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 21 May 2009 09:21:56 +0000 (09:21 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13730 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/deliver/Deliver_SMTP.class.php
src/configtest.php

index 279b82cc8204592603e99e5a7da5685e28b0ec06..2d0aa966078ca15649a34fbfe82323fa429599c6 100644 (file)
@@ -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 */
index 261ed2f874d1e63a4e546998060241b0a398c7a5..030acf2daa641f4f0b2b2d138096aa28ba7cdbdf 100644 (file)
@@ -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;