Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit

Permalink
Update TemplateProcessor.php
Browse files Browse the repository at this point in the history
  • Loading branch information
cHeeSaW authored Apr 22, 2020
1 parent b9002ef commit e2c820d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PhpWord/TemplateProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ public function cloneBlock($blockname, $clones = 1, $replace = true, $indexVaria
$xmlBlock = null;
$matches = array();
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,
$matches
);
Expand Down

0 comments on commit e2c820d

Please sign in to comment.