From 4e46337cdd2272e2a44653207342e8b7411f8911 Mon Sep 17 00:00:00 2001 From: stekkel Date: Wed, 11 Jun 2003 17:54:12 +0000 Subject: [PATCH] extra safetycheck before we process group addresses git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4998 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_general.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/functions/imap_general.php b/functions/imap_general.php index 6e52519d..c7c41fcb 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -607,14 +607,18 @@ function parseAddress($address, $max=0, $addr_ar = array(), $group = '', $host=' break; case ':': /* process the group addresses */ /* group marker */ - $group = substr($address, 0, $pos); - $address = substr($address, $pos+1); - $result = parseAddress($address, $max, $addr_ar, $group); - $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 = parseAddress($address, $max, $addr_ar, $group); + $addr_ar = $result[0]; + $pos = $result[1]; + $address = substr($address, $pos++); + $j = strlen($address); + $group = ''; + } else { + $pos = $j; + } break; default: ++$pos; -- 2.25.1