diff options
author | Chad Horohoe <demon@users.mediawiki.org> | 2010-12-15 19:55:08 +0000 |
---|---|---|
committer | Chad Horohoe <demon@users.mediawiki.org> | 2010-12-15 19:55:08 +0000 |
commit | a13e752b69cf306ec7b1be6af007eaafd5ef5d3d (patch) | |
tree | 994d993ddf4e35b8afc70423ca4524a53352de0f /includes/UserMailer.php | |
parent | 0fdaebe1815254fc45969781432e4e1a8cc234ce (diff) | |
download | mediawikicore-a13e752b69cf306ec7b1be6af007eaafd5ef5d3d.tar.gz mediawikicore-a13e752b69cf306ec7b1be6af007eaafd5ef5d3d.zip |
When using safe_mode, mail() cannot take the 5th parameter. Rather than (needlessly) disabling e-mail confirmation as a result, just disregard the parameter. Pointed out by Kunda on IRC.
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/78447
Diffstat (limited to 'includes/UserMailer.php')
-rw-r--r-- | includes/UserMailer.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 91eaab730284..17fd74cf33d1 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -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(); |