PHP versions 5.2.x have a default value of 100000 on pcre.backtrack_limit. We stumbled on the issue in 0.7-beta with the work supporting amp-bind.
We are using amp-iframe as a container for a table with a lot of rows and some javascript to help filter that table. We're injecting the iframe source through the srcdoc attribute. The regex matching tag attributes eventually will hit backtrack limit, fail with a PREG_BACKTRACK_LIMIT_ERROR silently, and AMP_Dom_Utils::convert_amp_bind_attributes will return null.
Further along the stack, this null value will be fed to DOMDocument which will cause a fatal error.
I'm opening up a PR shortly with some failing tests. I've made an attempt at modifying the regex, but I can't get all the tests to pass with my changes so I'm opening up this issue to the broader community.
PHP versions 5.2.x have a default value of
100000onpcre.backtrack_limit. We stumbled on the issue in0.7-betawith the work supporting amp-bind.We are using
amp-iframeas a container for a table with a lot of rows and some javascript to help filter that table. We're injecting the iframe source through thesrcdocattribute. The regex matching tag attributes eventually will hit backtrack limit, fail with aPREG_BACKTRACK_LIMIT_ERRORsilently, andAMP_Dom_Utils::convert_amp_bind_attributeswill returnnull.Further along the stack, this
nullvalue will be fed toDOMDocumentwhich will cause a fatal error.I'm opening up a PR shortly with some failing tests. I've made an attempt at modifying the regex, but I can't get all the tests to pass with my changes so I'm opening up this issue to the broader community.