fix for Bug #93 “tilde signatures inside nowiki tags sometimes get expanded (<include...
authorMark A. Hershberger <mah@users.mediawiki.org>
Fri, 27 May 2011 20:55:02 +0000 (20:55 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Fri, 27 May 2011 20:55:02 +0000 (20:55 +0000)
Patch from Brad Jorsch

Fix for includeonly case.  Hopefully fixing this ancient bug doesn't
‘cause people to cry

includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php

index 2dd3efd..b08ed09 100644 (file)
@@ -185,6 +185,9 @@ class Preprocessor_DOM implements Preprocessor {
                        if ( strpos( $text, '<onlyinclude>' ) !== false && strpos( $text, '</onlyinclude>' ) !== false ) {
                                $enableOnlyinclude = true;
                        }
+               } else if ( $this->parser->ot['wiki'] ) {
+                       $ignoredTags = array( 'noinclude', '/noinclude', 'onlyinclude', '/onlyinclude', 'includeonly', '/includeonly' );
+                       $ignoredElements = array();
                } else {
                        $ignoredTags = array( 'noinclude', '/noinclude', 'onlyinclude', '/onlyinclude' );
                        $ignoredElements = array( 'includeonly' );
index b84b39d..7f175e5 100644 (file)
@@ -144,6 +144,9 @@ class Preprocessor_Hash implements Preprocessor {
                        if ( strpos( $text, '<onlyinclude>' ) !== false && strpos( $text, '</onlyinclude>' ) !== false ) {
                                $enableOnlyinclude = true;
                        }
+               } else if ( $this->parser->ot['wiki'] ) {
+                       $ignoredTags = array( 'noinclude', '/noinclude', 'onlyinclude', '/onlyinclude', 'includeonly', '/includeonly' );
+                       $ignoredElements = array();
                } else {
                        $ignoredTags = array( 'noinclude', '/noinclude', 'onlyinclude', '/onlyinclude' );
                        $ignoredElements = array( 'includeonly' );