Author: efeins
Description:
A form of extension call inside a template will cause another extension not to
be called. Instead, an intermediate of the wikitext is rendered.
Version info:
MediaWiki: 1.5.2
PHP: 4.3.10-16etch1 (apache2handler)
MySQL: 4.1.14-Debian_6-log
Example:
The following extension:
<code>
<?php
$wgExtensionFunctions[] = "wfTestExtension";
function wfTestExtension() {
global $wgParser;
$wgParser->setHook( "inner", "innerHook" );
$wgParser->setHook( "inside", "insideHook" );
}
function innerHook( $input, $argv ) {
- set a variable
global $wgOut;
$output = $output.$wgOut->parse($input, false);
return $output;
}
function insideHook( $input, $argv ) {
return "(inside)";
}
?>
</code>
And the following wikitext (in a page called Test_Page):
<code>
Here is the test:
<p>outer text 1</p>
<inner>
<p>inner text 1</p>
<inside></inside>
{{:ATemplate}}
<p>inner text 2</p>
</inner>
<p>outer text 2</p>
</code>
And the following Wikitext in ATemplate:
<code>
<inner>
<inside></inside>
</inner>
</code>
Renders Test_Page as:
<pre>
Here is the test:
outer text 1
inner text 1
NaodW29-inside593e7feb7eece2e700000001
(inside)
inner text 2
outer text 2
</pre>
Note that it's the <inside></inside> call in Test_Page that is failing. The one
in ATemplate works correctly.
IF ATemplate is changed to:
<code>
<inside></inside>
</code>
removing the calls to inner, it renders correctly as:
<pre>
Here is the test:
outer text 1
inner text 1
(inside) (inside)
inner text 2
outer text 2
</pre>
So, the nested call to inner inside a template fails.
Nested extension calls outside a template never work because the inner instance
of the /inner tag will close the outer call to inner.
Version: 1.5.x
Severity: normal
OS: Linux
Platform: PC