This is probably an issue with core MediaWiki Parser or my implementation of the extension.
I have a custom extension that defines various parser hooks, as the code is not open source I am sharing a small version of the code with relevant parts.
$wgHooks['ParserFirstCallInit'][] = 'wfSampleSetup';
function wfSampleSetup( Parser $parser ) {
$parser->setHook( 'xyz', 'xyzRender' );
$parser->setHook( 'abc', 'abcRender' );
}
function xyzRender( $input, array $args, Parser $parser, PPFrame $frame ) {
...
}
function abcRender( $input, array $args, Parser $parser, PPFrame $frame ) {
if (empty($input)) {
header('Location: http://www.website.com');
die();
}
...
}On pages that have 'abc' with empty 'input' it should redirect to the homepage. However pages with content 'xyz' also seem to be calling abcRender() and redirecting to the website homepage.
I tried to print the stack trace just before the redirect call and it seems that the fn is getting called from:
extensionSubstitution in Parser.php