* Avoid corrupting <gallery> inside <!-- comment -->
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 18 Feb 2006 01:50:12 +0000 (01:50 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 18 Feb 2006 01:50:12 +0000 (01:50 +0000)
RELEASE-NOTES
includes/Parser.php
maintenance/parserTests.txt

index 753b4fb..277665f 100644 (file)
@@ -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 <gallery> inside <!-- comment -->
 
 
 === Caveats ===
index 0d73a4a..829a7b3 100644 (file)
@@ -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;
index e474778..30e9cdf 100644 (file)
@@ -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
 <!-- <gallery>data</gallery> -->
 !!end
 
+!! test
+pre-save transform: comment containing extension
+!! options
+pst
+!! input
+<!-- <tag>data</tag> -->
+!!result
+<!-- <tag>data</tag> -->
+!!end
+
 !! test
 pre-save transform: comment containing nowiki
 !! options