Tweichart has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/218299

Change subject: fix for mail ln
......................................................................

fix for mail ln

* according to mw and wp line endings need to be different on windows and unix
* change copied from mw
* replacing \n with \n or \r\n whenever needed
(needs merge to master and if possible to rel1_22)

Change-Id: Ib7c3c1e62d66943b6ae15ce3c08b640dbae8a1f5
---
M includes/Mailer.class.php
1 file changed, 13 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/99/218299/1

diff --git a/includes/Mailer.class.php b/includes/Mailer.class.php
index f0a0674..7260f11 100644
--- a/includes/Mailer.class.php
+++ b/includes/Mailer.class.php
@@ -49,14 +49,22 @@
        public function send( $vTo, $sSubject, $sMsg, $oFrom = null ) {
                wfProfileIn( 'BS::'.__METHOD__ );
                $oStatus = Status::newGood(); // TODO RBV (01.03.12 12:59): Use 
fatal...?
+               # found in mw 1.23 UserMailer.php ln 250
+               # Line endings need to be different on Unix and Windows due to
+               # the bug described at http://trac.wordpress.org/ticket/2603
+               if ( wfIsWindows() ) {
+                       $sEndl = "\r\n";
+               } else {
+                       $sEndl = "\n";
+               }
 
-               $sCurLF = "\n";
-               $sReplLF = '<br />'."\n";
+               $sCurLF = $sEndl;
+               $sReplLF = '<br />' . $sEndl;
                $sHeaders = null;
 
                if ( $this->bSendHTML ) {
-                       $sCurLF = '<br/>'."\n";
-                       $sReplLF = "\n";
+                       $sCurLF = '<br/>' . $sEndl;
+                       $sReplLF = $sEndl;
                        $sHeaders = 'text/html; charset=utf-8';
                }
 
@@ -119,7 +127,7 @@
                }
 
                //Note that this is system lang!
-               $sNL = $this->bSendHTML ? "<br />" : "\n";
+               $sNL = $this->bSendHTML ? "<br />" : $sEndl;
                $sFooter =
                        "$sNL$sNL---------------------$sNL$sNL"
                        .wfMessage( 'bs-email-footer', $wgSitename )->text()

-- 
To view, visit https://gerrit.wikimedia.org/r/218299
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib7c3c1e62d66943b6ae15ce3c08b640dbae8a1f5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: REL1_23
Gerrit-Owner: Tweichart <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to