array of objects tostring conversion works correctly in php 5.2.3+
authorMark A. Hershberger <mah@users.mediawiki.org>
Thu, 28 Jul 2011 17:25:19 +0000 (17:25 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Thu, 28 Jul 2011 17:25:19 +0000 (17:25 +0000)
includes/UserMailer.php

index 5140dc9..4b8ee6b 100644 (file)
@@ -137,18 +137,8 @@ class UserMailer {
                global $wgSMTP, $wgEnotifImpersonal;
                global $wgEnotifMaxRecips, $wgAdditionalMailParams;
 
-               if ( is_array( $to ) ) {
-                       $emails = '';
-                       // This wouldn't be necessary if implode() worked on arrays of
-                       // objects using __toString(). http://bugs.php.net/bug.php?id=36612
-                       foreach ( $to as $t ) {
-                                       $emails .= $t->toString() . ",";
-                       }
-                       $emails = rtrim( $emails, ',' );
-                       wfDebug( __METHOD__ . ': sending mail to ' . $emails . "\n" );
-               } else {
-                       wfDebug( __METHOD__ . ': sending mail to ' . implode( ',', array( $to->toString() ) ) . "\n" );
-               }
+               $emails = '';
+               wfDebug( __METHOD__ . ': sending mail to ' . implode( ',', array( $to->toString() ) ) . "\n" );
 
                $headers['From'] = $from->toString();
                $headers['Return-Path'] = $from->toString();