r14430 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14429‎ | r14430 | r14431 >
Date:09:07, 28 May 2006
Author:brion
Status:old
Tags:
Comment:
Change the method used to reverse arrays on unstrip of nowiki and html.
Did similar for other unstrip a while ago because it started mysteriously
blowing up; now getting mysteriuos blowups on these too, not sure why.
Only seems ot be affecting zhwiki for some reason
Modified paths:
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -587,14 +587,14 @@
588588 }
589589
590590 # Must expand in reverse order, otherwise nested tags will be corrupted
591 - for ( $content = end($state['nowiki']); $content !== false; $content = prev( $state['nowiki'] ) ) {
592 - $text = str_replace( key( $state['nowiki'] ), $content, $text );
 591+ foreach( array_reverse( $state['nowiki'], true ) as $uniq => $content ) {
 592+ $text = str_replace( $uniq, $content, $text );
593593 }
594594
595595 global $wgRawHtml;
596596 if ($wgRawHtml) {
597 - for ( $content = end($state['html']); $content !== false; $content = prev( $state['html'] ) ) {
598 - $text = str_replace( key( $state['html'] ), $content, $text );
 597+ foreach( array_reverse( $state['html'], true ) as $uniq => $content ) {
 598+ $text = str_replace( $uniq, $content, $text );
599599 }
600600 }
601601

Status & tagging log