From 3e7fd9f58c972802f941541c6d838d2dfd6343ca Mon Sep 17 00:00:00 2001 From: bsitu Date: Sun, 23 Jun 2013 18:06:47 -0700 Subject: [PATCH] Fix the error in html email when pear mail_mime is missing When pear package mail_mime is missing, attempt to send html email throws error: mail() expects parameter 3 to be string, array given. This is because the code doesn't unset the html part of the body when falling back to text email Change-Id: Ie8c73a481cb9003a0b43893cf4751475bdf5c690 --- includes/UserMailer.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 2a549ac49c..8e3f048dbb 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -258,6 +258,8 @@ class UserMailer { wfDebug( "Assembling multipart mime email\n" ); if ( !stream_resolve_include_path( 'Mail/mime.php' ) ) { wfDebug( "PEAR Mail_Mime package is not installed. Falling back to text email.\n" ); + // remove the html body for text email fall back + $body = $body['text']; } else { require_once 'Mail/mime.php'; -- 2.20.1