Normalize "\r" newlines in preSaveTransform
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 15 Dec 2014 21:59:42 +0000 (16:59 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Mon, 15 Dec 2014 21:59:42 +0000 (16:59 -0500)
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

index 5c8253a..a9daa22 100644 (file)
@@ -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() ) {