philippe_mingo 24 rokov pred
rodič
commit
1229641206
2 zmenil súbory, kde vykonal 5 pridanie a 5 odobranie
  1. 1 1
      functions/display_messages.php
  2. 4 4
      functions/strings.php

+ 1 - 1
functions/display_messages.php

@@ -86,4 +86,4 @@
       echo '   </TD></TR>';
       echo '</TABLE>';
     }
-?>
+?>

+ 4 - 4
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 );
    }