HomePhabricator

T104523: Prevent infinite recursion

Authored by Arlolra on Dec 8 2016, 3:56 AM.

Description

T104523: Prevent infinite recursion

  • The TokenTransformManager already has loop and depth detection mechanisms, they just weren't being used when calling out to the php preprocessor. This was under the faulty assumption that we'd never get into nesting scenarios, since all our expansion is done for us.
  • However, template expansion returns unrendered extension tags, which have higher precedence than templates. For extensions that support wikitext, like ref and gallery, we can then get recursive calls for template expansion and ugliness ensues.

    The seeds of this are alluded to here, https://github.com/wikimedia/parsoid/blob/master/lib/utils/DOMTraverser.js#L91-L93

Change-Id: I2ad86a7862ca68a469c5038ca250006be2347318

Details

Committed
ArlolraDec 12 2016, 11:18 PM
Parents
rGPAR0ec92dffa4ea: Move section handling to the LST extension
Branches
Unknown
Tags
Unknown
ChangeId
I2ad86a7862ca68a469c5038ca250006be2347318