mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-09-24 10:48:58 +00:00
Move $this->mParser setters up one level
Two motivations: 1. I want the two deeper nested functions guardedRef() and guardedReferences() to have less side effects. 2. In guardedReferences() guardedRef() is called. Both set the property. That's redundant. The new code avoids this. Change-Id: I48146f8b6d91122a904be0a552ffe3b03bc0481f
This commit is contained in:
parent
d2cc18d38a
commit
bd72636b95
|
@ -203,6 +203,7 @@ class Cite {
|
|||
}
|
||||
|
||||
$this->mCallCnt++;
|
||||
$this->mParser = $parser;
|
||||
$this->mInCite = true;
|
||||
|
||||
$ret = $this->guardedRef( $text, $argv, $parser );
|
||||
|
@ -235,8 +236,6 @@ class Cite {
|
|||
array $argv,
|
||||
Parser $parser
|
||||
) {
|
||||
$this->mParser = $parser;
|
||||
|
||||
# The key here is the "name" attribute.
|
||||
list( $key, $group, $follow, $dir, $refines ) = $this->refArg( $argv );
|
||||
// empty string indicate invalid dir
|
||||
|
@ -654,10 +653,13 @@ class Cite {
|
|||
}
|
||||
return htmlspecialchars( "<references>$text</references>" );
|
||||
}
|
||||
|
||||
$this->mCallCnt++;
|
||||
$this->mParser = $parser;
|
||||
$this->mInReferences = true;
|
||||
$ret = $this->guardedReferences( $text, $argv, $parser );
|
||||
$this->mInReferences = false;
|
||||
|
||||
$frame->setVolatile();
|
||||
return $ret;
|
||||
}
|
||||
|
@ -678,8 +680,6 @@ class Cite {
|
|||
) {
|
||||
global $wgCiteResponsiveReferences;
|
||||
|
||||
$this->mParser = $parser;
|
||||
|
||||
$group = $argv['group'] ?? self::DEFAULT_GROUP;
|
||||
unset( $argv['group'] );
|
||||
|
||||
|
|
Loading…
Reference in a new issue