Skip to content

Commit

Permalink
[TYPO] Fix hardcoded macro chars in TemplateProcessor method (#2618)
Browse files Browse the repository at this point in the history
* Fix hardcoded macro chars

* Update changelog

---------

Co-authored-by: glafarge <[email protected]>
  • Loading branch information
glafarge and glafarge authored Aug 7, 2024
1 parent 7084019 commit b99230a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/changes/2.x/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- 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)
- 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)
- 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)
- Typo : Fix hardcoded macro chars in TemplateProcessor method [@glafarge](https://github.com/glafarge) in [#2618](https://github.com/PHPOffice/PHPWord/pull/2618)

### Miscellaneous

Expand Down
4 changes: 2 additions & 2 deletions src/PhpWord/TemplateProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,8 @@ public function cloneRow($search, $numberOfClones): void
*/
public function deleteRow(string $search): void
{
if ('${' !== substr($search, 0, 2) && '}' !== substr($search, -1)) {
$search = '${' . $search . '}';
if (self::$macroOpeningChars !== substr($search, 0, 2) && self::$macroClosingChars !== substr($search, -1)) {
$search = self::$macroOpeningChars . $search . self::$macroClosingChars;
}

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

0 comments on commit b99230a

Please sign in to comment.