Applied a fix for some formatting issue with mail adresses in the
authorteepe <teepe@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 11 Jan 2002 18:30:41 +0000 (18:30 +0000)
committerteepe <teepe@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 11 Jan 2002 18:30:41 +0000 (18:30 +0000)
foo@bar.org ()
format. It was submitted by "Kurt Yoder" <kylist@shcorp.com>

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

functions/imap_general.php

index 9333f17..1c598fa 100755 (executable)
@@ -349,7 +349,15 @@ function sqimap_find_displayable_name ($string) {
         $string = ereg_replace ('"', '', $regs[1] );
     }
     elseif ( ereg('\((.*)\)', $string, $regs) ) {
-        $string = $regs[1];
+        if( ( $regs[1] == '' ) || ( $regs[1] == ' ' ) ){
+            if ( ereg('^(.+) \(', $string, $regs) ) {
+               $string = ereg_replace( ' \(\)$', '', $string );
+            } else {
+               $string = '&nbsp';
+            }
+        } else {
+            $string = $regs[1];
+        }
     }
     else {
         $string = sqimap_find_email($string);