Page MenuHomePhabricator

Elements mysteriously empty in PPNode_DOM XML serialization
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Open http://en.wikipedia.org/w/index.php?title=Template:Zh-full&action=edit&oldid=317512308 and copy the wikitext into the text field at http://en.wikipedia.org/wiki/Special:ExpandTemplates.
  2. Check "Show XML parse tree" and press OK
  3. Search in the XML output for the string "<comment></comment>"

Note that the output can't be correct, because a comment node must contain at least the opening "<!--" characters.

A few notes:

  • This is not a bug of Special:Expandtemplates, as the api output of action=expandtemplates is the same.
  • It appears to happen only very rarely and for certain input values
  • The actual preprocessor output appears to be correct, which is why I suspect it might be a bug in the ->saveXML function of the DOM XML extension.

Version: 1.16.x
Severity: minor
URL: http://en.wikpiedia.org/w/index.php?title=Template:Zh-full&action=edit&oldid=317512308

Details

Reference
bz21681

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:54 PM
bzimport set Reference to bz21681.
bzimport added a subscriber: Unknown Object (MLST).

I have an alternate test case, not changed by much:

{{xxxxxxxxxxxxxx|x={{{1|}}}}}<!--
-->{{xxxx{{{2|}}}|{{x}} {{xxxxxxxxxxxxxx|x={{{2|}}}}}}}<!--
-->{{xxxx{{{3|}}}|{{x}} {{xxxxxxxxxxxxxx|x={{{3|}}}}}}}<!--
-->{{xxxx{{{4|}}}|{{x}} {{xxxxxxxxxxxxxx|x={{{4|}}}}}}}<!--
-->{{xxxx{{{5|}}}|{{x}} {{xxxxxxxxxxxxxx|x={{{5|}}}}}}}<!--
-->{{xxxx{{{6|}}}|{{x}} {{xxxxxxxxxxxxxx|x={{{6|}}}}}}}<!--
-->{{xxxx{{{7|}}}|{{x}} {{xxxxxxxxxxxxxx|x={{{7|}}}}}}}<!--
-->{{xxxx{{{8|}}}|{{x}} {{xxxxxxxxxxxxxx|x={{{8|}}}}}}}<!--
-->{{xxxx{{{9|}}}|{{x}} {{xxxxxxxxxxxxxx|x={{{9|}}}}}}}<!--
-->{{xxxx{{{10|}}}|{{x}} {{xxxxxxxxxxxxxx|x={{{10|}}}}}}}<!--
-->{{xxxx{{{11|}}}|{{x}} {{xxxxxxxxxxxxxx|x={{{11|}}}}}}}<!--DELETED
-->{{xxxx{{{12|}}}|{{x}} {{xxxxxxxxxxxxxx|x={{{12|}}}}}}}<noinclude>
{{documentation}}
</noinclude>

Note that the bug is sensitive to length and will stop working if you delete or duplicate lines, or if you change the length of the "xxxxxxxxxxxxxx" template name by more than a couple of characters. In the output, there is no DELETED string, that comment becomes empty.

If this happened in the DOM, instead of on serialization, then it would be impossible to save this text to the wiki since it would be corrupted during pre-save transform.

Googling around a bit, I probably found the reason: http://www.mail-archive.com/xml@gnome.org/msg05436.html

Since they fixed the issue in Feb 2008, the bug should disappear when the servers are upgraded to anything beyond PHP 5.2.6.

Should this report be left open until then or can it be closed as LATER?

Works for me. Seems an old bug. Could you please confirm it's fixed?

Wikipedia currently runs 5.3.10-1ubuntu3.4+wmf1, so judging from P.Copps information I would say: Fixed.