Index: trunk/phase3/includes/UserMailer.php |
— | — | @@ -99,7 +99,7 @@ |
100 | 100 | * array of parameters. It requires PEAR:Mail to do that. |
101 | 101 | * Otherwise it just uses the standard PHP 'mail' function. |
102 | 102 | * |
103 | | - * @param $to MailAddress: recipient's email |
| 103 | + * @param $to MailAddress: recipient's email (or an array of them) |
104 | 104 | * @param $from MailAddress: sender's email |
105 | 105 | * @param $subject String: email's subject. |
106 | 106 | * @param $body String: email's text. |
— | — | @@ -112,6 +112,12 @@ |
113 | 113 | global $wgEnotifMaxRecips; |
114 | 114 | |
115 | 115 | if ( is_array( $to ) ) { |
| 116 | + // This wouldn't be necessary if implode() worked on arrays of |
| 117 | + // objects using __toString(). http://bugs.php.net/bug.php?id=36612 |
| 118 | + foreach( $to as $t ) { |
| 119 | + $emails .= $t->toString() . ","; |
| 120 | + } |
| 121 | + $emails = rtrim( $emails, ',' ); |
116 | 122 | wfDebug( __METHOD__.': sending mail to ' . implode( ',', $to ) . "\n" ); |
117 | 123 | } else { |
118 | 124 | wfDebug( __METHOD__.': sending mail to ' . implode( ',', array( $to->toString() ) ) . "\n" ); |