Skip to content

Commit d965a69

Browse files
committed
Fix: CloneBlock regexp for different regexp engine with xml line-drop
1 parent b8346af commit d965a69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PhpWord/TemplateProcessor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ public function cloneBlock($blockname, $clones = 1, $replace = true, $indexVaria
737737
$xmlBlock = null;
738738
$matches = array();
739739
preg_match(
740-
'/(<\?xml.*)(<w:p\b.*>\${' . $blockname . '}<\/w:.*?p>)(.*)(<w:p\b.*\${\/' . $blockname . '}<\/w:.*?p>)/is',
740+
'/(.*((?s)<w:p\b(?:(?!<w:p\b).)*?\${' . $blockname . '}<\/w:.*?p>))(.*)((?s)<w:p\b(?:(?!<w:p\b).)*?\${\/' . $blockname . '}<\/w:.*?p>)/is',
741741
$this->tempDocumentMainPart,
742742
$matches
743743
);

0 commit comments

Comments
 (0)