Skip to content

TemplateProcessor::cloneBlock() doesn't work with PHP v7.3+ #1836

Open
@cedrictailly

Description

@cedrictailly

Describe the Bug

It seems the regex used to search the block doesn't work with a template we use, the problem seems to be in relation with the lazy quantifiers, large strings and PHP v7.3 and superior, it works well with PHP v7.2.

Steps to Reproduce

I can't send the template because it's confidential, but :

  • When I test lazy quantifiers on simple tests nothing is wrong (PHP v7.3 + v7.4).
  • When I test with exact same data minus unuseful tags it works too (PHP v7.3 + v7.4).
  • When I test with the full file content there is no match with PHP v7.3+ but a match with v7.2.

Expected Behavior

The blocks have to be cloned...

Current Behavior

...but tags remain visibles.

Context

  • PHP Version: 7.3+
  • PHPWord Version: 0.17.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions