Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TemplateProcessor] Fix 0 considered as empty string #2617

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/changes/1.x/1.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@
- Add test case to make sure vMerge defaults to 'continue' by [@SpraxDev](https://github.com/SpraxDev) in [#2677](https://github.com/PHPOffice/PHPWord/pull/2677)

### BC Breaks

- TemplateProcessor: Fix 0 considered as empty string. Fixing [#2572](https://github.com/PHPOffice/PHPWord/issues/2572) in [#2617](https://github.com/PHPOffice/PHPWord/pull/2617)
2 changes: 1 addition & 1 deletion src/PhpWord/TemplateProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ protected static function ensureMacroCompleted($macro)
*/
protected static function ensureUtf8Encoded($subject)
{
return $subject ? Text::toUTF8($subject) : '';
return (null !== $subject) ? Text::toUTF8($subject) : '';
}

/**
Expand Down
Loading