r76236 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76235‎ | r76236 | r76237 >
Date:09:40, 7 November 2010
Author:ialex
Status:ok (Comments)
Tags:
Comment:
Kill E_STRICTs from Mail package
Modified paths:
  • /trunk/phase3/includes/UserMailer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/UserMailer.php
@@ -172,10 +172,13 @@
173173 $headers['Message-ID'] = "<$msgid@" . $wgSMTP['IDHost'] . '>'; // FIXME
174174 $headers['X-Mailer'] = 'MediaWiki mailer';
175175
 176+ wfSuppressWarnings();
 177+
176178 // Create the mail object using the Mail::factory method
177179 $mail_object =& Mail::factory('smtp', $wgSMTP);
178180 if( PEAR::isError( $mail_object ) ) {
179181 wfDebug( "PEAR::Mail factory failed: " . $mail_object->getMessage() . "\n" );
 182+ wfRestoreWarnings();
180183 return new WikiError( $mail_object->getMessage() );
181184 }
182185
@@ -183,9 +186,12 @@
184187 $chunks = array_chunk( (array)$dest, $wgEnotifMaxRecips );
185188 foreach ($chunks as $chunk) {
186189 $e = self::sendWithPear($mail_object, $chunk, $headers, $body);
187 - if( WikiError::isError( $e ) )
 190+ if( WikiError::isError( $e ) ) {
 191+ wfRestoreWarnings();
188192 return $e;
 193+ }
189194 }
 195+ wfRestoreWarnings();
190196 } else {
191197 # In the following $headers = expression we removed "Reply-To: {$from}\r\n" , because it is treated differently
192198 # (fifth parameter of the PHP mail function, see some lines below)

Comments

#Comment by Hashar (talk | contribs)   07:31, 16 November 2010

\o/

Status & tagging log