Merge pull request #1809 from juzser/dev-master

Update the regexp to avoid catastrophic backtracking
This commit is contained in:
troosan 2021-02-07 23:42:57 +01:00 committed by GitHub
commit ca45d14511
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -798,7 +798,7 @@ class TemplateProcessor
$xmlBlock = null; $xmlBlock = null;
$matches = array(); $matches = array();
preg_match( preg_match(
'/(<\?xml.*)(<w:p\b.*>\${' . $blockname . '}<\/w:.*?p>)(.*)(<w:p\b.*\${\/' . $blockname . '}<\/w:.*?p>)/is', '/(.*((?s)<w:p\b(?:(?!<w:p\b).)*?\${' . $blockname . '}<\/w:.*?p>))(.*)((?s)<w:p\b(?:(?!<w:p\b).)[^$]*?\${\/' . $blockname . '}<\/w:.*?p>)/is',
$this->tempDocumentMainPart, $this->tempDocumentMainPart,
$matches $matches
); );