From 27e3ec2919ad545847e92bd2e5c990cea4467988 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 18 Feb 2006 01:50:12 +0000 Subject: [PATCH] * Avoid corrupting inside --- RELEASE-NOTES | 1 + includes/Parser.php | 4 ++-- maintenance/parserTests.txt | 12 +++++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 753b4fb2bb..277665f8fa 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -627,6 +627,7 @@ fully support the editing toolbar, but was found to be too confusing. * Removed trailing whitespace on a bunch more messages. * Fix missing bad title check in Special:Booksources * Remove empty booksources string in fy +* Avoid corrupting inside === Caveats === diff --git a/includes/Parser.php b/includes/Parser.php index 0d73a4a916..829a7b342a 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -478,8 +478,8 @@ class Parser $state['nowiki'] = $state['nowiki'] + $nowiki_content; $state['math'] = $state['math'] + $math_content; $state['pre'] = $state['pre'] + $pre_content; - $state['comment'] = $state['comment'] + $comment_content; $state['gallery'] = $state['gallery'] + $gallery_content; + $state['comment'] = $state['comment'] + $comment_content; foreach( $ext_content as $tag => $array ) { if ( array_key_exists( $tag, $state ) ) { @@ -492,8 +492,8 @@ class Parser 'nowiki' => $nowiki_content, 'math' => $math_content, 'pre' => $pre_content, - 'comment' => $comment_content, 'gallery' => $gallery_content, + 'comment' => $comment_content, ) + $ext_content; } return $text; diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index e4747785f6..30e9cdfdd8 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -2224,7 +2224,7 @@ Template:dangerous !! end !! test -pre-save transform: comment containing extension (bug 5024) +pre-save transform: comment containing gallery (bug 5024) !! options pst !! input @@ -2233,6 +2233,16 @@ pst !!end +!! test +pre-save transform: comment containing extension +!! options +pst +!! input + +!!result + +!!end + !! test pre-save transform: comment containing nowiki !! options -- 2.20.1