Move wfDebug() call about use of PHP mail() function to _before_ we mess around with...
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 18 May 2009 19:08:53 +0000 (19:08 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 18 May 2009 19:08:53 +0000 (19:08 +0000)
Previously, a failure to open the debug log file for writing would end up getting reported as a failure of mail delivery, even though we were successful.
It'll now fail silently (as it should) and won't interfere with the actual mail() call's error reporting.

includes/UserMailer.php

index b648493..97195fb 100644 (file)
@@ -188,11 +188,12 @@ class UserMailer {
                                $headers .= "{$endl}Reply-To: " . $replyto->toString();
                        }
 
+                       wfDebug( "Sending mail via internal mail() function\n" );
+                       
                        $wgErrorString = '';
                        $html_errors = ini_get( 'html_errors' );
                        ini_set( 'html_errors', '0' );
                        set_error_handler( array( 'UserMailer', 'errorHandler' ) );
-                       wfDebug( "Sending mail via internal mail() function\n" );
 
                        if (function_exists('mail')) {
                                if (is_array($to)) {