From 9ed750e026c99bef2ac5a13d72447391b00cbcfc Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Thu, 28 Jul 2011 17:25:19 +0000 Subject: [PATCH] array of objects tostring conversion works correctly in php 5.2.3+ --- includes/UserMailer.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 5140dc95d9..4b8ee6b300 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -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(); -- 2.20.1