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.2 deprecation warning, passing NULL to htmlspecialchars #355

Open
davidearl opened this issue Jan 24, 2024 · 2 comments
Open

PHP 8.2 deprecation warning, passing NULL to htmlspecialchars #355

davidearl opened this issue Jan 24, 2024 · 2 comments

Comments

@davidearl
Copy link

Many thanks for this code.

I have some quite strict error checking in place, and I am getting a deprecation warning in PHP 8.2 that I don't get in earlier versions of PHP

It happens when some properties are not set, like Company or Title.

The properties in the main class are not initialized. So when it comes to writing them out, it passes NULL to htmlspecialchars in buildAppXML, passing an uninitialised variable to a system function. That is now deprecated, but probably unintentional.

Is etc required in the format? If not, I'd suggest omitting it if it is not set. If it is, I'd suggest initialising the various properties (as tags are for example).

Obviously, I worked around this by calling the setter functions for these, which without parameters do initialise the problem properties.

@Kadigan
Copy link

Kadigan commented Apr 3, 2024

I am having the same issue. I would expect these values to either be initialised, or - should they explicitly not be by contributor choice - for an E_NOTICE to be emitted, so that I'm aware that I must set them.

@sayid
Copy link

sayid commented Apr 3, 2024 via email

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

No branches or pull requests

3 participants