r93400 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93399‎ | r93400 | r93401 >
Date:17:25, 28 July 2011
Author:mah
Status:ok
Tags:
Comment:
array of objects tostring conversion works correctly in php 5.2.3+
Modified paths:
  • /trunk/phase3/includes/UserMailer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/UserMailer.php
@@ -137,18 +137,8 @@
138138 global $wgSMTP, $wgEnotifImpersonal;
139139 global $wgEnotifMaxRecips, $wgAdditionalMailParams;
140140
141 - if ( is_array( $to ) ) {
142 - $emails = '';
143 - // This wouldn't be necessary if implode() worked on arrays of
144 - // objects using __toString(). http://bugs.php.net/bug.php?id=36612
145 - foreach ( $to as $t ) {
146 - $emails .= $t->toString() . ",";
147 - }
148 - $emails = rtrim( $emails, ',' );
149 - wfDebug( __METHOD__ . ': sending mail to ' . $emails . "\n" );
150 - } else {
151 - wfDebug( __METHOD__ . ': sending mail to ' . implode( ',', array( $to->toString() ) ) . "\n" );
152 - }
 141+ $emails = '';
 142+ wfDebug( __METHOD__ . ': sending mail to ' . implode( ',', array( $to->toString() ) ) . "\n" );
153143
154144 $headers['From'] = $from->toString();
155145 $headers['Return-Path'] = $from->toString();

Status & tagging log