From: Kevin Israel Date: Mon, 2 Sep 2013 22:12:45 +0000 (-0400) Subject: Web installer: correctly show note for I4ecd0659 X-Git-Tag: 1.31.0-rc.0~18767^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=4bec48cb473beda460393d1e17572594d5c85dce;p=lhc%2Fweb%2Fwiklou.git 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 --- 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}