mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-12-18 09:40:49 +00:00
Rewrite loop in ReferenceStack
Change-Id: I3bdf26fd14573abdcad989c7ebfea48e49ef42aa
This commit is contained in:
parent
f00b21943b
commit
249982e353
|
@ -139,12 +139,13 @@ class ReferenceStack {
|
||||||
|
|
||||||
if ( $follow ) {
|
if ( $follow ) {
|
||||||
$ref['follow'] = $follow;
|
$ref['follow'] = $follow;
|
||||||
// insert broken follow at the end of any other broken follows.
|
// This inserts the broken "follow" at the end of all other broken "follow"
|
||||||
$groupsCount = count( $this->refs[$group] );
|
$k = 0;
|
||||||
for ( $k = 0; $k < $groupsCount; $k++ ) {
|
foreach ( $this->refs[$group] as $value ) {
|
||||||
if ( !isset( $this->refs[$group][$k]['follow'] ) ) {
|
if ( !isset( $value['follow'] ) ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$k++;
|
||||||
}
|
}
|
||||||
array_splice( $this->refs[$group], $k, 0, [ $ref ] );
|
array_splice( $this->refs[$group], $k, 0, [ $ref ] );
|
||||||
array_splice( $this->refCallStack, $k, 0,
|
array_splice( $this->refCallStack, $k, 0,
|
||||||
|
|
Loading…
Reference in a new issue