mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CiteThisPage
synced 2024-11-30 18:34:24 +00:00
Cite: Fix bug 11224 (finally): in some obscure cases (notably when parsing for an anon without edit rights), Parser::clearState() somehow got in the call path of Cite::ref(), clearing the Cite state in mid-parse every time. I've worked around this by refusing to clear state if the state indicates we're in the middle of parsing something, but this is probably not a proper fix as there seems to be something deeply evil going on in the Parser (big surprise) causing it to clear state haphazardly. Anyone interested in further investigation should read the backtrace I posted on bug 11224
This commit is contained in:
parent
9c4ed9ef45
commit
2986a5a8d2
|
@ -657,6 +657,11 @@ class Cite {
|
|||
* want the counts to transcend pages and other instances
|
||||
*/
|
||||
function clearState() {
|
||||
# Don't clear state when we're in the middle of parsing
|
||||
# a <ref> tag
|
||||
if($this->mInCite)
|
||||
return true;
|
||||
|
||||
$this->mGroupCnt = array();
|
||||
$this->mOutCnt = -1;
|
||||
$this->mInCnt = 0;
|
||||
|
|
Loading…
Reference in a new issue