extra safety check before we process groups
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 11 Jun 2003 17:53:17 +0000 (17:53 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 11 Jun 2003 17:53:17 +0000 (17:53 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4997 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/mime/Rfc822Header.class.php

index a331124..91bd626 100644 (file)
@@ -389,14 +389,18 @@ class Rfc822Header {
                 break;
             case ':':  /* process the group addresses */
                 /* group marker */
-                $group = substr($address, 0, $pos);
-                $address = substr($address, $pos+1);
-                $result = $this->parseAddress($address, $ar, $addr_ar, $group, $lookup);
-                $addr_ar = $result[0];
-                $pos = $result[1];
-                $address = substr($address, $pos++);
-                $j = strlen($address);
-                $group = '';
+               if (strpos($address,';',$pos)) {
+                   $group = substr($address, 0, $pos);
+                   $address = substr($address, $pos+1);
+                   $result = $this->parseAddress($address, $ar, $addr_ar, $group, $lookup);
+                   $addr_ar = $result[0];
+                   $pos = $result[1];
+                   $address = substr($address, $pos++);
+                   $j = strlen($address);
+                   $group = '';
+               } else {
+                   $pos = $j;
+               }
                 break;
             case ' ':
                 ++$pos;