From 2690a3fe363544e678d59353d08feb6c6c53228e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 28 May 2006 09:07:42 +0000 Subject: [PATCH] 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 --- includes/Parser.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index 6e335c270a..17ffdd4107 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -587,14 +587,14 @@ class Parser } # Must expand in reverse order, otherwise nested tags will be corrupted - for ( $content = end($state['nowiki']); $content !== false; $content = prev( $state['nowiki'] ) ) { - $text = str_replace( key( $state['nowiki'] ), $content, $text ); + foreach( array_reverse( $state['nowiki'], true ) as $uniq => $content ) { + $text = str_replace( $uniq, $content, $text ); } global $wgRawHtml; if ($wgRawHtml) { - for ( $content = end($state['html']); $content !== false; $content = prev( $state['html'] ) ) { - $text = str_replace( key( $state['html'] ), $content, $text ); + foreach( array_reverse( $state['html'], true ) as $uniq => $content ) { + $text = str_replace( $uniq, $content, $text ); } } -- 2.20.1