Merge pull request #1809 from juzser/dev-master
Update the regexp to avoid catastrophic backtracking
This commit is contained in:
commit
ca45d14511
|
|
@ -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
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue