From 5c1eeb2464f56848ef955dfcf2beeb1cfbf70570 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Mon, 15 Dec 2014 16:59:42 -0500 Subject: [PATCH] Normalize "\r" newlines in preSaveTransform The behavior of the different preprocessors differs when given \r or \r\n newlines. We already normalize the latter here, so may as well do the former here too. Bug: T78488 Change-Id: Id6390f64a73ea01088729f25d79103388c1fe7e8 --- includes/parser/Parser.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 5c8253a0c3..a9daa22309 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -4862,6 +4862,7 @@ class Parser { $pairs = array( "\r\n" => "\n", + "\r" => "\n", ); $text = str_replace( array_keys( $pairs ), array_values( $pairs ), $text ); if ( $options->getPreSaveTransform() ) { -- 2.20.1