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 9333f177fb8755c6ce067fe08ba85b3d611eebe4..1c598fa9415ac412c0f7c2e318c0930a76b26d2a 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);