Skip to content

Commit 1c5bb3a

Browse files
author
Roman Syroeshko
committed
1 parent 28f801b commit 1c5bb3a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ so installation via ZIP-archive download is not an option anymore. To install PH
3939

4040
### Fixed
4141
- `Undefined property` error while reading MS-DOC documents. - @jaberu #610
42+
- Corrupted OOXML template issue in case when its macro is broken immediately after `$` sign.
43+
That case wasn't taken into account in implementation of `TemplateProcessor::fixBrokenMacros()`. - @RomanSyroeshko @d-damien #548
4244

4345

4446

src/PhpWord/TemplateProcessor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ protected function fixBrokenMacros($documentPart)
385385
$fixedDocumentPart = $documentPart;
386386

387387
$fixedDocumentPart = preg_replace_callback(
388-
'|\$\{([^\}]+)\}|U',
388+
'|\$[^{]*\{[^}]*\}|U',
389389
function ($match) {
390390
return strip_tags($match[0]);
391391
},

0 commit comments

Comments
 (0)