Submitted By: Thijs Kinkhorst (kink)
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 28 Dec 2001 16:09:55 +0000 (16:09 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 28 Dec 2001 16:09:55 +0000 (16:09 +0000)
Assigned to: Nobody/Anonymous (nobody)
Summary: Nice display of "em@ail.com (Real Name)"

Initial Comment:
This patch adds nicer display for From lines in the format:
john@doe.com (John Doe)

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1983 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_general.php

index cac7b59..a9e1882 100755 (executable)
@@ -355,6 +355,11 @@ function sqimap_find_displayable_name ($string) {
         if (trim($string) == '') {
             $string = sqimap_find_email($orig_string);
         }
+     } else if (strpos($string, '(') && strpos($string, ')')) {
+         $fn_start = strpos($string, '(') + 1;
+         $fn_len   = strpos($string, ')') - $fn_start;
+         $string = substr($string, $fn_start, $fn_len);
     }
     return $string;
 }