mediawiki-extensions-Cite/src
Thiemo Kreuz 0cc1ddeccb More robust property initialization in ReferenceStack
I tried many things, but wasn't able to reproduce the error
described in T283755. What probably happens goes like this:
* Somehow $this->refs[$group] is initialized, but
  $this->groupRefSequence[$group] is not.
* There are not many places in the code where this can
  happen. There are a few suspicious lines in rollbackRef(),
  but they are all guarded. The only problematic place is in
  appendText().
* This problematic line is only called for <ref> in
  <references>.
* Somehow a <ref> is valid enough to make it to appendText(),
  but not valid enough to make it to pushRef().
* The next time another <ref> is added to the same group, it
  appears like the group already exists ($this->refs[$group]
  is set), but $this->groupRefSequence[$group] is missing.

I was unable to find a wikitext example that would behave like
this.

This patch just makes sure the initialization is done but
doesn't care why it was missing. The following code is fine
with an existing ref that contains nothing but text (which is
how appendText() leaves it behind).

Bug: T283755
Change-Id: I36ac56ef6ed98676a3e8f430a796826351a5f4e9
2021-05-31 14:10:07 +02:00
..
Hooks Update Cite to use the new HookContainer/HookRunner system 2020-12-28 17:55:34 +02:00
ResourceLoader Coerce type to please linter 2021-02-24 18:46:18 +00:00
AnchorFormatter.php Remove TODOs and FIXMEs that we are not going to fix 2020-01-23 07:27:27 +00:00
Cite.php Merge "Restore preview of a <references> section alone" 2020-07-28 13:19:01 +00:00
ErrorReporter.php Rewrite ErrorReporter for performance and separation of concerns 2020-02-03 15:23:40 +01:00
FootnoteMarkFormatter.php Do not add thousands separators when formatting reference numbers 2020-05-28 00:08:44 +02:00
ReferenceMessageLocalizer.php Stop using Language::formatNum to localize separators 2020-09-02 09:40:33 +02:00
ReferencesFormatter.php build: Updating composer dependencies 2021-05-04 01:29:20 +00:00
ReferenceStack.php More robust property initialization in ReferenceStack 2021-05-31 14:10:07 +02:00