diff --git a/src/PhpWord/TemplateProcessor.php b/src/PhpWord/TemplateProcessor.php index 7a5eaf55bb..e0af589769 100644 --- a/src/PhpWord/TemplateProcessor.php +++ b/src/PhpWord/TemplateProcessor.php @@ -445,7 +445,7 @@ protected function fixBrokenMacros($documentPart) $fixedDocumentPart = $documentPart; $fixedDocumentPart = preg_replace_callback( - '|\$[^{]*\{[^}]*\}|U', + '/\$(?:\{|[^{$]*\>\{)[^}$]*\}/U', function ($match) { return strip_tags($match[0]); },