http://www.mediawiki.org/wiki/Special:Code/MediaWiki/76236

Revision: 76236
Author:   ialex
Date:     2010-11-07 09:40:34 +0000 (Sun, 07 Nov 2010)
Log Message:
-----------
Kill E_STRICTs from Mail package

Modified Paths:
--------------
    trunk/phase3/includes/UserMailer.php

Modified: trunk/phase3/includes/UserMailer.php
===================================================================
--- trunk/phase3/includes/UserMailer.php        2010-11-07 09:32:36 UTC (rev 
76235)
+++ trunk/phase3/includes/UserMailer.php        2010-11-07 09:40:34 UTC (rev 
76236)
@@ -172,10 +172,13 @@
                        $headers['Message-ID'] = "<$msgid@" . $wgSMTP['IDHost'] 
. '>'; // FIXME
                        $headers['X-Mailer'] = 'MediaWiki mailer';
 
+                       wfSuppressWarnings();
+
                        // Create the mail object using the Mail::factory method
                        $mail_object =& Mail::factory('smtp', $wgSMTP);
                        if( PEAR::isError( $mail_object ) ) {
                                wfDebug( "PEAR::Mail factory failed: " . 
$mail_object->getMessage() . "\n" );
+                               wfRestoreWarnings();
                                return new WikiError( 
$mail_object->getMessage() );
                        }
 
@@ -183,9 +186,12 @@
                        $chunks = array_chunk( (array)$dest, $wgEnotifMaxRecips 
);
                        foreach ($chunks as $chunk) {
                                $e = self::sendWithPear($mail_object, $chunk, 
$headers, $body);
-                               if( WikiError::isError( $e ) )
+                               if( WikiError::isError( $e ) ) {
+                                       wfRestoreWarnings();
                                        return $e;
+                               }
                        }
+                       wfRestoreWarnings();
                } else  {
                        # In the following $headers = expression we removed 
"Reply-To: {$from}\r\n" , because it is treated differently
                        # (fifth parameter of the PHP mail function, see some 
lines below)


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to