make use of new parseRFC822Address function
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 26 May 2004 01:18:42 +0000 (01:18 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 26 May 2004 01:18:42 +0000 (01:18 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7553 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php

index 5afd303..2edf381 100755 (executable)
@@ -193,8 +193,13 @@ function get_squirrel_sort ($imap_stream, $sSortField, $reverse = false) {
         if(!$walk) {
             array_walk($msgs, create_function('&$v,&$k,$f',
                 '$v[$f] = (isset($v[$f])) ? $v[$f] : "";
-                 $addr = parseAddress($v[$f]);
-                 $v[$f] = ($addr[0][1]) ? decodeHeader($addr[0][1]):$addr[0][0];'),$sSortField);
+                 $addr = reset(parseRFC822Address($v[$f],1));
+                 $sPersonal = (isset($addr[SQM_ADDR_PERSONAL]) && $addr[SQM_ADDR_PERSONAL]) ?
+                   $addr[SQM_ADDR_PERSONAL] : "";
+                 $sEmail = ($addr[SQM_ADDR_HOST]) ?
+                      $addr[SQM_ADDR_HOST] . "@".$addr[SQM_ADDR_HOST] :
+                      $addr[SQM_ADDR_HOST];
+                 $v[$f] = ($sPersonal) ? decodeHeader($sPersonal):$sEmail;'),$sSortField);
             $walk = true;
         }
         // nobreak