mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-27 16:30:12 +00:00
(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:
parent
f5e96b7613
commit
e7de455f88
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue