Skip to content
New issue

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

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

Already on GitHub? # to your account

Error in php 8.1 #225

Open
mikeborisov78 opened this issue Jan 27, 2023 · 1 comment
Open

Error in php 8.1 #225

mikeborisov78 opened this issue Jan 27, 2023 · 1 comment

Comments

@mikeborisov78
Copy link

src/HTML5/Parser/UTF8Utils.php

$data = mb_convert_encoding($data, 'UTF-8', $encoding);

error if $data is null in PHP 8.1
help this:

$data = mb_convert_encoding($data.'', 'UTF-8', $encoding);

@stof
Copy link
Contributor

stof commented Jan 30, 2023

The phpdoc on the method declares the contract as @param string $data. So you should only pass a string.

Btw, this won't trigger an error on PHP 8.1 but only a deprecation warning.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants