From d46b103b62ebd5f37610dc32091ca7d2ea9a6580 Mon Sep 17 00:00:00 2001 From: philippe_mingo Date: Tue, 30 Oct 2001 16:42:08 +0000 Subject: [PATCH] Coma bugfix git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1659 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/display_messages.php | 2 +- functions/strings.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/functions/display_messages.php b/functions/display_messages.php index 89305b72..7c787d3b 100644 --- a/functions/display_messages.php +++ b/functions/display_messages.php @@ -86,4 +86,4 @@ echo ' '; echo ''; } -?> +?> \ No newline at end of file diff --git a/functions/strings.php b/functions/strings.php index 70bf69a1..afafffba 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -161,14 +161,14 @@ function getLineOfAddrs($array) { if (is_array($array)) { $to_line = implode(', ', $array); - $to_line = trim(ereg_replace(', (, )+', ', ', $to_line)); + $to_line = ereg_replace(', (, )+', ', ', $to_line); + $to_line = trim(ereg_replace('^, ', '', $to_line)); + if( substr( $to_line, -1 ) == ',' ) + $to_line = substr( $to_line, 0, -1 ); } else { $to_line = ''; } - if( substr( $to_line, -1 ) == ',' ) - $to_line = substr( $to_line, 0, strlen( $to_line ) - 1 ); - return( $to_line ); } -- 2.25.1