Web installer: correctly show note for I4ecd0659
authorKevin Israel <pleasestand@live.com>
Mon, 2 Sep 2013 22:12:45 +0000 (18:12 -0400)
committerKevin Israel <pleasestand@live.com>
Sun, 15 Sep 2013 18:31:50 +0000 (14:31 -0400)
InstallDocFormatter didn't escape the double underscores in
__TOC__. I also noticed that wfEscapeWikiText had a similar
bug, which I reported as bug 53658 (fixed separately).

Change-Id: Ib5346b9c234f1c5ef361cc4357352b09def5dc25

includes/installer/InstallDocFormatter.php
tests/phpunit/includes/installer/InstallDocFormatterTest.php

index a508e24..ce282cc 100644 (file)
@@ -33,8 +33,8 @@ class InstallDocFormatter {
        protected function execute() {
                $text = $this->text;
                // Use Unix line endings, escape some wikitext stuff
-               $text = str_replace( array( '<', '{{', '[[', "\r" ),
-                       array( '&lt;', '&#123;&#123;', '&#91;&#91;', '' ), $text );
+               $text = str_replace( array( '<', '{{', '[[', '__', "\r" ),
+                       array( '&lt;', '&#123;&#123;', '&#91;&#91;', '&#95;&#95;', '' ), $text );
                // join word-wrapped lines into one
                do {
                        $prev = $text;
index 342f7d5..ea87ede 100644 (file)
@@ -27,6 +27,7 @@ class InstallDocFormatterTest extends MediaWikiTestCase {
                        array( 'Install &lt;tag>', 'Install <tag>', 'Escaping <' ),
                        array( 'Install &#123;&#123;template}}', 'Install {{template}}', 'Escaping [[' ),
                        array( 'Install &#91;&#91;page]]', 'Install [[page]]', 'Escaping {{' ),
+                       array( 'Install &#95;&#95;TOC&#95;&#95;', 'Install __TOC__', 'Escaping __' ),
                        array( 'Install ', "Install \r", 'Removing \r' ),
 
                        # Transform \t{1,2} into :{1,2}