From 2986a5a8d2fe4d5a4f127274781df5a46bdee33d Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 16 Jun 2008 14:04:39 +0000 Subject: [PATCH] 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 --- Cite_body.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cite_body.php b/Cite_body.php index 52b6e69bc..320f4030b 100644 --- a/Cite_body.php +++ b/Cite_body.php @@ -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 tag + if($this->mInCite) + return true; + $this->mGroupCnt = array(); $this->mOutCnt = -1; $this->mInCnt = 0;