From: Mark A. Hershberger Date: Thu, 28 Jul 2011 17:25:19 +0000 (+0000) Subject: array of objects tostring conversion works correctly in php 5.2.3+ X-Git-Tag: 1.31.0-rc.0~28560 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=9ed750e026c99bef2ac5a13d72447391b00cbcfc;p=lhc%2Fweb%2Fwiklou.git array of objects tostring conversion works correctly in php 5.2.3+ --- 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();