(bug 47291) Make sure cloned Cite is cleared

The cloned Cite object in the ParserCloned hook must be cleared, even if
the clone occurs inside a <ref> or <references> tag. The simple way to
do this is to set mInCite and mInReferences to false before calling
clearState().

While Cite could probably use a major cleanup, let's fix this bug now
instead of waiting for someone to get around to it.

Bug: 47291
Change-Id: Id3e91c41dc33a703b5326961fd57e1fe8ac61f5b
This commit is contained in:
Brad Jorsch 2013-04-16 15:38:05 -04:00
parent f5e96b7613
commit e7de455f88

View file

@ -1072,6 +1072,10 @@ class Cite {
$parser->extCite = clone $this;
$parser->setHook( 'ref' , array( $parser->extCite, 'ref' ) );
$parser->setHook( 'references' , array( $parser->extCite, 'references' ) );
// Clear the state, making sure it will actually work.
$parser->extCite->mInCite = false;
$parser->extCite->mInReferences = false;
$parser->extCite->clearState( $parser );
return true;