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

Alterd the function ensureUtf8Encoded to return only an empty string on null and false #2566

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

SnipsMine
Copy link

@SnipsMine SnipsMine commented Feb 6, 2024

Description

I ran into a problem that nothing was printed when 0 was given as the value for function TemplateProcessor->setValue(). I tracked this issue down to the function ensureUtf8Encoded that checked if $subject was true, instead of is not null.

I changed the line to check if $subject is null and only then return a empty string else the value is send to Text::toUTF8().

The test I wrote might be a bit overkill, but I hope it sufficient to test te fix

Checklist:

  • I have run composer run-script check --timeout=0 and no errors were reported
  • The new code is covered by unit tests (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes

SnipsMine and others added 2 commits February 6, 2024 20:02
I changed the function ensureUtf8Encoded so that it only returns an empty string when it is null.
@coveralls
Copy link

coveralls commented Feb 6, 2024

Coverage Status

coverage: 97.217%. remained the same
when pulling cb1ba73 on SnipsMine:master
into 8b891bb on PHPOffice:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants