Index: trunk/phase3/includes/UserMailer.php |
— | — | @@ -172,10 +172,13 @@ |
173 | 173 | $headers['Message-ID'] = "<$msgid@" . $wgSMTP['IDHost'] . '>'; // FIXME |
174 | 174 | $headers['X-Mailer'] = 'MediaWiki mailer'; |
175 | 175 | |
| 176 | + wfSuppressWarnings(); |
| 177 | + |
176 | 178 | // Create the mail object using the Mail::factory method |
177 | 179 | $mail_object =& Mail::factory('smtp', $wgSMTP); |
178 | 180 | if( PEAR::isError( $mail_object ) ) { |
179 | 181 | wfDebug( "PEAR::Mail factory failed: " . $mail_object->getMessage() . "\n" ); |
| 182 | + wfRestoreWarnings(); |
180 | 183 | return new WikiError( $mail_object->getMessage() ); |
181 | 184 | } |
182 | 185 | |
— | — | @@ -183,9 +186,12 @@ |
184 | 187 | $chunks = array_chunk( (array)$dest, $wgEnotifMaxRecips ); |
185 | 188 | foreach ($chunks as $chunk) { |
186 | 189 | $e = self::sendWithPear($mail_object, $chunk, $headers, $body); |
187 | | - if( WikiError::isError( $e ) ) |
| 190 | + if( WikiError::isError( $e ) ) { |
| 191 | + wfRestoreWarnings(); |
188 | 192 | return $e; |
| 193 | + } |
189 | 194 | } |
| 195 | + wfRestoreWarnings(); |
190 | 196 | } else { |
191 | 197 | # In the following $headers = expression we removed "Reply-To: {$from}\r\n" , because it is treated differently |
192 | 198 | # (fifth parameter of the PHP mail function, see some lines below) |