Skip to content

PHP 8.2 deprecation warning, passing NULL to htmlspecialchars #355

@davidearl

Description

@davidearl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions