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

PHP 8.1 Depreciation messages #2264

Closed
mbursa opened this issue Jul 18, 2022 · 3 comments
Closed

PHP 8.1 Depreciation messages #2264

mbursa opened this issue Jul 18, 2022 · 3 comments

Comments

@mbursa
Copy link

mbursa commented Jul 18, 2022

Using PHPWord 0.18.3 in am getting the following two deprecation messages from PHP 8.1:

Type: 8192
Text: strlen(): Passing null to parameter #1 ($string) of type string is deprecated
File: php_modules/phpoffice/phpword/src/PhpWord/Style/Language.php
Line: 235
Type: 8192
Text: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated
File: php_modules/phpoffice/phpword/src/PhpWord/TemplateProcessor.php
Line: 984

The input type of strlen is string and of str_replace is array|string. I believe the values passed to that function should be sanitized using ?? operator.

thanks

@Jack-ST94
Copy link

Have you tried updating your composer?

@mbursa
Copy link
Author

mbursa commented Jul 22, 2022

I have. I believe the fix is trivial, I may submit a PR for it, I think.

@PowerKiKi
Copy link
Member

Fixed in #2272

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

No branches or pull requests

3 participants