Skip to content

Commit b99230a

Browse files
authored
[TYPO] Fix hardcoded macro chars in TemplateProcessor method (#2618)
* Fix hardcoded macro chars * Update changelog --------- Co-authored-by: glafarge <glafarge@users.noreply.github.com>
1 parent 7084019 commit b99230a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/changes/2.x/2.0.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- TemplateProcessor Destructor Problem with Php7 [@oleibman](https://github.com/oleibman) fixing [#2548](https://github.com/PHPOffice/PHPWord/issues/2548) in [#2554](https://github.com/PHPOffice/PHPWord/pull/2554)
1717
- bug: TemplateProcessor fix multiline values [@gimler](https://github.com/gimler) fixing [#268](https://github.com/PHPOffice/PHPWord/issues/268), [#2323](https://github.com/PHPOffice/PHPWord/issues/2323) and [#2486](https://github.com/PHPOffice/PHPWord/issues/2486) in [#2522](https://github.com/PHPOffice/PHPWord/pull/2522)
1818
- 32-bit Problem in PasswordEncoder [@oleibman](https://github.com/oleibman) fixing [#2550](https://github.com/PHPOffice/PHPWord/issues/2550) in [#2551](https://github.com/PHPOffice/PHPWord/pull/2551)
19+
- Typo : Fix hardcoded macro chars in TemplateProcessor method [@glafarge](https://github.com/glafarge) in [#2618](https://github.com/PHPOffice/PHPWord/pull/2618)
1920

2021
### Miscellaneous
2122

src/PhpWord/TemplateProcessor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,8 +805,8 @@ public function cloneRow($search, $numberOfClones): void
805805
*/
806806
public function deleteRow(string $search): void
807807
{
808-
if ('${' !== substr($search, 0, 2) && '}' !== substr($search, -1)) {
809-
$search = '${' . $search . '}';
808+
if (self::$macroOpeningChars !== substr($search, 0, 2) && self::$macroClosingChars !== substr($search, -1)) {
809+
$search = self::$macroOpeningChars . $search . self::$macroClosingChars;
810810
}
811811

812812
$tagPos = strpos($this->tempDocumentMainPart, $search);

0 commit comments

Comments
 (0)