Another fix.
[lhc/web/wiklou.git] / includes / UserMailer.php
index 55f6799..b2d1a4f 100644 (file)
@@ -77,9 +77,9 @@ class MailAddress {
  * @param $from MailAddress: sender's email
  * @param $subject String: email's subject.
  * @param $body String: email's text.
- * @param $replyto String: optional reply-to email (default: false).
+ * @param $replyto String: optional reply-to email (default: null).
  */
-function userMailer( $to, $from, $subject, $body, $replyto=false ) {
+function userMailer( $to, $from, $subject, $body, $replyto=null ) {
        global $wgUser, $wgSMTP, $wgOutputEncoding, $wgErrorString;
 
        if (is_array( $wgSMTP )) {
@@ -91,7 +91,7 @@ function userMailer( $to, $from, $subject, $body, $replyto=false ) {
                $headers['From'] = $from->toString();
                $headers['To'] = $to->toString();
                if ( $replyto ) {
-                       $headers['Reply-To'] = $replyto;
+                       $headers['Reply-To'] = $replyto->toString();
                }
                $headers['Subject'] = wfQuotedPrintable( $subject );
                $headers['Date'] = date( 'r' );
@@ -140,7 +140,7 @@ function userMailer( $to, $from, $subject, $body, $replyto=false ) {
                        "X-Mailer: MediaWiki mailer$endl".
                        'From: ' . $from->toString();
                if ($replyto) {
-                       $headers .= "{$endl}Reply-To: $replyto";
+                       $headers .= "{$endl}Reply-To: " . $replyto->toString();
                }
 
                $dest = $to->toString();
@@ -245,7 +245,7 @@ class EmailNotification {
                                $userCondition = false;
                        }
                        if( $userCondition ) {
-                               $dbr =& wfGetDB( DB_MASTER );
+                               $dbr = wfGetDB( DB_MASTER );
 
                                $res = $dbr->select( 'watchlist', array( 'wl_user' ),
                                        array(
@@ -292,7 +292,7 @@ class EmailNotification {
                if ( $wgShowUpdatedMarker || $wgEnotifWatchlist ) {
                        # mark the changed watch-listed page with a timestamp, so that the page is
                        # listed with an "updated since your last visit" icon in the watch list, ...
-                       $dbw =& wfGetDB( DB_MASTER );
+                       $dbw = wfGetDB( DB_MASTER );
                        $success = $dbw->update( 'watchlist',
                                array( /* SET */
                                        'wl_notificationtimestamp' => $dbw->timestamp($timestamp)
@@ -368,7 +368,7 @@ class EmailNotification {
                        }
                } else {
                        $from    = $adminAddress;
-                       $replyto = $wgNoReplyAddress;
+                       $replyto = new MailAddress( $wgNoReplyAddress );
                }
 
                if( $wgUser->isIP( $name ) ) {