r67740 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67739‎ | r67740 | r67741 >
Date:18:04, 9 June 2010
Author:demon
Status:ok
Tags:
Comment:
Escape {{, [[ and < in doc pages (not all wikitext, we still want headings, bullets and external links)
Modified paths:
  • /trunk/phase3/includes/installer/WebInstaller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/WebInstaller.php
@@ -1663,6 +1663,8 @@
16641664 }
16651665
16661666 protected function formatTextFile( $text ) {
 1667+ $text = str_replace( array( '<', '{{', '[[' ),
 1668+ array( '&lt;', '&#123;&#123;', '&#91;&#91;' ), $text );
16671669 // replace numbering with [1], [2], etc with MW-style numbering
16681670 $text = preg_replace( "/\r?\n(\r?\n)?\\[\\d+\\]/m", "\\1#", $text );
16691671 // join word-wrapped lines into one

Status & tagging log