From 9e9c63e450f5db18ede8ea744f7e9807e413bf66 Mon Sep 17 00:00:00 2001 From: teepe Date: Fri, 11 Jan 2002 18:30:41 +0000 Subject: [PATCH] Applied a fix for some formatting issue with mail adresses in the foo@bar.org () format. It was submitted by "Kurt Yoder" git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2118 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_general.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/functions/imap_general.php b/functions/imap_general.php index 9333f177..1c598fa9 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -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 = ' '; + } + } else { + $string = $regs[1]; + } } else { $string = sqimap_find_email($string); -- 2.25.1