Fix: Catastrophic Backtracking RegExp

This commit is contained in:
oe.sonnh 2020-01-21 16:42:19 +07:00
parent d965a69601
commit 608730531f
1 changed files with 1 additions and 1 deletions

View File

@ -737,7 +737,7 @@ class TemplateProcessor
$xmlBlock = null;
$matches = array();
preg_match(
'/(.*((?s)<w:p\b(?:(?!<w:p\b).)*?\${' . $blockname . '}<\/w:.*?p>))(.*)((?s)<w:p\b(?:(?!<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,
$matches
);