From: Chad Horohoe Date: Wed, 9 Jun 2010 18:04:48 +0000 (+0000) Subject: Escape {{, [[ and < in doc pages (not all wikitext, we still want headings, bullets... X-Git-Tag: 1.31.0-rc.0~36565 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=c1e94db05997ce514ddb7165439ada0d6dc84a79;p=lhc%2Fweb%2Fwiklou.git Escape {{, [[ and < in doc pages (not all wikitext, we still want headings, bullets and external links) --- diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 95e1f81782..547bf66fc5 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -1663,6 +1663,8 @@ abstract class WebInstaller_Document extends WebInstallerPage { } protected function formatTextFile( $text ) { + $text = str_replace( array( '<', '{{', '[[' ), + array( '<', '{{', '[[' ), $text ); // replace numbering with [1], [2], etc with MW-style numbering $text = preg_replace( "/\r?\n(\r?\n)?\\[\\d+\\]/m", "\\1#", $text ); // join word-wrapped lines into one