r36333 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36332‎ | r36333 | r36334 >
Date:14:04, 16 June 2008
Author:catrope
Status:old
Tags:
Comment:
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
Modified paths:
  • /trunk/extensions/Cite/Cite_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Cite/Cite_body.php
@@ -657,6 +657,11 @@
658658 * want the counts to transcend pages and other instances
659659 */
660660 function clearState() {
 661+ # Don't clear state when we're in the middle of parsing
 662+ # a <ref> tag
 663+ if($this->mInCite)
 664+ return true;
 665+
661666 $this->mGroupCnt = array();
662667 $this->mOutCnt = -1;
663668 $this->mInCnt = 0;

Status & tagging log