Forráskód Böngészése

Anchor the regexp. Thanks Thijs Kinkhorst.

pdontthink 16 éve
szülő
commit
6618a28091
2 módosított fájl, 2 hozzáadás és 2 törlés
  1. 1 1
      class/deliver/Deliver_SMTP.class.php
  2. 1 1
      src/configtest.php

+ 1 - 1
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 */

+ 1 - 1
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;