Index: trunk/phase3/includes/UserMailer.php |
— | — | @@ -67,6 +67,8 @@ |
68 | 68 | } else { |
69 | 69 | return $this->address; |
70 | 70 | } |
| 71 | + } else { |
| 72 | + return ""; |
71 | 73 | } |
72 | 74 | } |
73 | 75 | |
— | — | @@ -153,6 +155,9 @@ |
154 | 156 | } else if( $to->address ) { |
155 | 157 | $dest[] = $to->address; |
156 | 158 | } |
| 159 | + if ( count( $dest ) == 0 ) { |
| 160 | + return Status::newFatal( 'user-mail-no-addy' ); |
| 161 | + } |
157 | 162 | |
158 | 163 | if ( $wgEnotifImpersonal ) { |
159 | 164 | $headers['To'] = 'undisclosed-recipients:;'; |
— | — | @@ -231,12 +236,9 @@ |
232 | 237 | ini_set( 'html_errors', '0' ); |
233 | 238 | set_error_handler( 'UserMailer::errorHandler' ); |
234 | 239 | |
235 | | - if ( !is_array( $to ) ) { |
236 | | - $to = array( $to ); |
| 240 | + foreach ( $dest as $recip ) { |
| 241 | + $sent = mail( $recip, self::quotedPrintable( $subject ), $body, $headers, $wgAdditionalMailParams ); |
237 | 242 | } |
238 | | - foreach ( $to as $recip ) { |
239 | | - $sent = mail( $recip->toString(), self::quotedPrintable( $subject ), $body, $headers, $wgAdditionalMailParams ); |
240 | | - } |
241 | 243 | |
242 | 244 | restore_error_handler(); |
243 | 245 | ini_set( 'html_errors', $html_errors ); |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1146,6 +1146,7 @@ |
1147 | 1147 | 'pear-mail-error' => '$1', # do not translate or duplicate this message to other languages |
1148 | 1148 | 'php-mail-error' => '$1', # do not translate or duplicate this message to other languages |
1149 | 1149 | 'php-mail-error-unknown' => "Unknown error in PHP's mail() function", |
| 1150 | +'user-mail-no-addy' => "Tried to send email without an email address", |
1150 | 1151 | |
1151 | 1152 | # Change password dialog |
1152 | 1153 | 'resetpass' => 'Change password', |