From: Brion Vibber Date: Sun, 28 May 2006 09:07:42 +0000 (+0000) Subject: Change the method used to reverse arrays on unstrip of nowiki and html. X-Git-Tag: 1.31.0-rc.0~56999 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/journal.php?a=commitdiff_plain;h=2690a3fe363544e678d59353d08feb6c6c53228e;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ); } }