From: Tim Starling Date: Wed, 16 Nov 2005 10:16:46 +0000 (+0000) Subject: Respect and during {{subst:}} expansion as well as ordinary... X-Git-Tag: 1.6.0~1168 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=876726286c296ba2b0a61f36cdaa1fbdccc97443;p=lhc%2Fweb%2Fwiklou.git Respect and during {{subst:}} expansion as well as ordinary templates. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6bedbc6345..ca13ac5ceb 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -228,6 +228,8 @@ fully support the editing toolbar, but was found to be too confusing. a warning in prefs and use default sig if not balanced) * (bug 2740) Accept image deletions on 'enter' submit from MSIE * (bug 3939) Don't try to load text for interwiki redirect target +* Respect and during {{subst:}} expansion as well as + ordinary templates. === Caveats === diff --git a/includes/Parser.php b/includes/Parser.php index 14f42e602d..648cc77d14 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -2504,16 +2504,18 @@ class Parser # Add a new element to the templace recursion path $this->mTemplatePath[$part1] = 1; + # If there are any tags, only include them + if ( in_string( '', $text ) && in_string( '', $text ) ) { + preg_match_all( '/(.*?)<\/onlyinclude>/s', $text, $m ); + $text = ''; + foreach ($m[1] as $piece) + $text .= $this->trimOnlyinclude( $piece ); + } + # Remove sections and tags + $text = preg_replace( '/.*?<\/noinclude>/s', '', $text ); + $text = strtr( $text, array( '' => '' , '' => '' ) ); + if( $this->mOutputType == OT_HTML ) { - if ( in_string( '', $text ) && in_string( '', $text ) ) { - preg_match_all( '/(.*?)<\/onlyinclude>/s', $text, $m ); - $text = ''; - foreach ($m[1] as $piece) - $text .= $this->trimOnlyinclude( $piece ); - } - # Remove sections and tags - $text = preg_replace( '/.*?<\/noinclude>/s', '', $text ); - $text = strtr( $text, array( '' => '' , '' => '' ) ); # Strip ,
, etc.
 				$text = $this->strip( $text, $this->mStripState );
 				$text = Sanitizer::removeHTMLtags( $text, array( &$this, 'replaceVariables' ), $assocArgs );