From: bsitu Date: Mon, 24 Jun 2013 01:06:47 +0000 (-0700) Subject: Fix the error in html email when pear mail_mime is missing X-Git-Tag: 1.31.0-rc.0~19350^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=3e7fd9f58c972802f941541c6d838d2dfd6343ca;p=lhc%2Fweb%2Fwiklou.git 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 --- 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';