Thanks for your analysis, Rolf.
I just looked at the PHP source of ParserFunctions, however, and #if is not evaluating anything:
function ifHook( &$parser, $test = '', $then = '', $else = '' ) { if ( $test !== '' ) { return $then; } else { return $else; } } $wgParser->setFunctionHook( 'if', array( &$wgExtParserFunctions, 'ifHook' ) );
So the values of $then and $else are getting evaluated somewhere else. Does this mean the issue lies with MediaWiki, not with ParserFunctions?
DanB