Go to file
Thiemo Kreuz df1a45b84c Fix incomplete cloning of the Parser::$extCite instance
This is what happens:
* The issue happens only on pages with two <ref> tags than share the
same name and group, but have conflicting text.
* This triggers a code path that renders an error message and calls
Message::plain() as well as Parser::addTrackingCategory(), which calls
Message::text().
* The Message class is asking for a new, fresh parser. This means the
parser is cloned and it's state cleared, while keeping stuff like
parser hooks.
* Cloning the parser triggers the ParserCloned hook.
* The hook handler clones the Cite instance stored in Parser::$extCite.
* PHP doesn't do deep cloning. Object properties are not cloned.
* Since I091a0b7 the internal state of the Cite class is extracted to
another class.
* This means the state is not cloned any more since I091a0b7.
* Now two Cite instances share the same state.
* At the end of the hook handler, the state is cleared, which also
clears the state of the original instance.

We will most probably solve this on master by getting rid of cloning
Cite. We propose this additional hotfix for the branch.

Bug: T240248
Change-Id: Ic5a438e04d003a637ae08aae936d9977cc90d5d3
2019-12-10 14:20:00 +00:00
.phan build: Upgrade mediawiki/mediawiki-phan-config from 0.5.0 to 0.6.0 2019-05-19 11:26:43 +00:00
i18n Localisation updates from https://translatewiki.net. 2019-12-10 09:29:05 +01:00
modules Merge "Add missing dot to "1.2." list numbering for extended refs" 2019-12-09 09:50:50 +00:00
src Fix incomplete cloning of the Parser::$extCite instance 2019-12-10 14:20:00 +00:00
tests Better naming for ReferenceFormatter class and methods 2019-12-10 08:40:09 +01:00
.eslintrc.json build: Update linters 2019-11-15 16:27:21 +00:00
.gitignore build: Upgrade eslint-config-wikimedia from 0.10.1 to 0.11.0 2019-04-03 22:58:56 +00:00
.gitreview Whoops, track not trace 2016-10-24 17:02:15 -07:00
.phpcs.xml Fix all PHPCS issues and add missing array type hints 2019-10-17 09:23:20 +02:00
.stylelintrc.json Use json extension for .stylelintrc 2017-08-19 09:39:19 +02:00
AUTHORS.txt Fix expected remove data to match actual remove data exactly 2017-08-13 11:41:30 -04:00
CODE_OF_CONDUCT.md build: Updating mediawiki/mediawiki-codesniffer to 22.0.0 2018-09-02 23:29:58 +00:00
composer.json Order build dependencies alphabetically 2019-12-05 14:08:00 +01:00
COPYING.txt Add license details and give credit to more authors (based on git shortlog) 2014-07-26 16:16:47 -07:00
extension.json Remove obsolete ParserBeforeTidy hook handler 2019-12-04 16:56:43 +01:00
Gruntfile.js build: Update linters 2019-11-15 16:27:21 +00:00
MIT-LICENSE.txt doc: Bump copyright year 2018-01-02 17:05:50 -08:00
package-lock.json build: Update linters 2019-11-15 16:27:21 +00:00
package.json build: Update linters 2019-11-15 16:27:21 +00:00
README.md Remove ApiQueryReferences support 2019-11-28 11:08:46 +01:00

Cite

The Cite extension provides a way for users to create references as footnotes to articles.

See https://www.mediawiki.org/wiki/Extension:Cite for detailed documentation.