From 4bec48cb473beda460393d1e17572594d5c85dce Mon Sep 17 00:00:00 2001 From: Kevin Israel Date: Mon, 2 Sep 2013 18:12:45 -0400 Subject: [PATCH] Web installer: correctly show note for I4ecd0659 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 | 4 ++-- tests/phpunit/includes/installer/InstallDocFormatterTest.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/installer/InstallDocFormatter.php b/includes/installer/InstallDocFormatter.php index a508e24cfa..ce282cc6f7 100644 --- a/includes/installer/InstallDocFormatter.php +++ b/includes/installer/InstallDocFormatter.php @@ -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( '<', '{{', '[[', '' ), $text ); + $text = str_replace( array( '<', '{{', '[[', '__', "\r" ), + array( '<', '{{', '[[', '__', '' ), $text ); // join word-wrapped lines into one do { $prev = $text; diff --git a/tests/phpunit/includes/installer/InstallDocFormatterTest.php b/tests/phpunit/includes/installer/InstallDocFormatterTest.php index 342f7d5a5e..ea87ede195 100644 --- a/tests/phpunit/includes/installer/InstallDocFormatterTest.php +++ b/tests/phpunit/includes/installer/InstallDocFormatterTest.php @@ -27,6 +27,7 @@ class InstallDocFormatterTest extends MediaWikiTestCase { array( 'Install <tag>', 'Install ', 'Escaping <' ), array( 'Install {{template}}', 'Install {{template}}', 'Escaping [[' ), array( 'Install [[page]]', 'Install [[page]]', 'Escaping {{' ), + array( 'Install __TOC__', 'Install __TOC__', 'Escaping __' ), array( 'Install ', "Install \r", 'Removing \r' ), # Transform \t{1,2} into :{1,2} -- 2.20.1