mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-12-18 01:30:32 +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 ) {
|
||||
$ref['follow'] = $follow;
|
||||
// insert broken follow at the end of any other broken follows.
|
||||
$groupsCount = count( $this->refs[$group] );
|
||||
for ( $k = 0; $k < $groupsCount; $k++ ) {
|
||||
if ( !isset( $this->refs[$group][$k]['follow'] ) ) {
|
||||
// This inserts the broken "follow" at the end of all other broken "follow"
|
||||
$k = 0;
|
||||
foreach ( $this->refs[$group] as $value ) {
|
||||
if ( !isset( $value['follow'] ) ) {
|
||||
break;
|
||||
}
|
||||
$k++;
|
||||
}
|
||||
array_splice( $this->refs[$group], $k, 0, [ $ref ] );
|
||||
array_splice( $this->refCallStack, $k, 0,
|
||||
|
|
Loading…
Reference in a new issue