Skip to content

Conversation

dafydd-rhys
Copy link

@dafydd-rhys dafydd-rhys commented Sep 16, 2025

Description

This PR fixes deprecation warnings in PHP 8.1+ caused by htmlspecialchars() receiving null.
The affected code paths occur when XML nodes or text content may be missing.

Fix applied by using the null coalescing operator (?? '') to ensure a string is always passed.

"DEPRECATE: vendor/phpoffice/phpword/src/PhpWord/Reader/Word2007/AbstractPart.php line 300 user unknown -- htmlspecialchars(): Passing null to parameter 0000001 ($string) of type string is deprecated"

Checklist:

  • My CI is 🟢
  • I have verified the fix removes the PHP 8.1 deprecation warning
  • I have covered by unit tests my new code (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes
  • I have updated the changelog

@coveralls
Copy link

Coverage Status

coverage: 96.757%. remained the same
when pulling e9218c3 on dafydd-rhys:FixHTMLSpecialCharsDeprecation
into 0ab0b49 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.

2 participants