Index: trunk/phase3/includes/Parser.php |
— | — | @@ -587,14 +587,14 @@ |
588 | 588 | } |
589 | 589 | |
590 | 590 | # 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 ); |
593 | 593 | } |
594 | 594 | |
595 | 595 | global $wgRawHtml; |
596 | 596 | 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 ); |
599 | 599 | } |
600 | 600 | } |
601 | 601 | |