* changed variable list as per comment on r79954 left only wgDBtype
[lhc/web/wiklou.git] / includes / UserMailer.php
index b93abb6..17fd74c 100644 (file)
@@ -223,12 +223,19 @@ class UserMailer {
                        ini_set( 'html_errors', '0' );
                        set_error_handler( array( 'UserMailer', 'errorHandler' ) );
 
-                       if ( is_array( $to ) ) {
-                               foreach ( $to as $recip ) {
+                       // We need to check for safe_mode, because mail() throws an E_NOTICE
+                       // on the 5th parameter when it's turned on
+                       $sm = wfIniGetBool( 'safe_mode' );
+
+                       if ( !is_array( $to ) ) {
+                               $to = array( $to );
+                       }
+                       foreach ( $to as $recip ) {
+                               if( $sm ) {
+                                       $sent = mail( $recip->toString(), self::quotedPrintable( $subject ), $body, $headers );
+                               } else {
                                        $sent = mail( $recip->toString(), self::quotedPrintable( $subject ), $body, $headers, $wgAdditionalMailParams );
                                }
-                       } else {
-                               $sent = mail( $to->toString(), self::quotedPrintable( $subject ), $body, $headers, $wgAdditionalMailParams );
                        }
 
                        restore_error_handler();
@@ -670,11 +677,4 @@ function userMailer( $to, $from, $subject, $body, $replyto = null ) {
        return UserMailer::send( $to, $from, $subject, $body, $replyto );
 }
 
-/**
- * @deprecated Use UserMailer method deprecated in 1.18, remove in 1.19.
- */
-function wfQuotedPrintable( $string, $charset = '' ) {
-       wfDeprecated( __FUNCTION__ );
-       return UserMailer::quotedPrintable( $string, $charset );
-}
 /**@}*/