From 885b5b842fd65c96f32041e7b89bda2d295d2a33 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 10 Nov 2015 17:28:32 -0800 Subject: [PATCH] UserMailer: Use PHP_EOL instead of DIY Also fixes arrayToHeaderString() to be correct when called without the $endl parameter Change-Id: I8b9f72500f9a055f9f2e1cfcbb276d565674f1b8 --- includes/mail/UserMailer.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/includes/mail/UserMailer.php b/includes/mail/UserMailer.php index 49ce21c7d2..85595f1286 100644 --- a/includes/mail/UserMailer.php +++ b/includes/mail/UserMailer.php @@ -64,7 +64,7 @@ class UserMailer { * * @return string */ - static function arrayToHeaderString( $headers, $endl = "\n" ) { + static function arrayToHeaderString( $headers, $endl = PHP_EOL ) { $strings = array(); foreach ( $headers as $name => $value ) { // Prevent header injection by stripping newlines from value @@ -292,11 +292,7 @@ class UserMailer { // Line endings need to be different on Unix and Windows due to // the bug described at http://trac.wordpress.org/ticket/2603 - if ( wfIsWindows() ) { - $endl = "\r\n"; - } else { - $endl = "\n"; - } + $endl = PHP_EOL; if ( is_array( $body ) ) { // we are sending a multipart message -- 2.20.1